I've always found the easiest way to get stats for an item is using tooltips. You can create a tooltip but never display it, simply pushing the item link to it in a function is sufficient. You can also obtain spell damage type with the text just using patterns.
Code:
local scantip = CreateFrame("GameTooltip", "MyScanningTooltip", nil, "GameTooltipTemplate")
scantip:SetOwner(UIParent, "ANCHOR_NONE")
local function MyGetItemStats(link)
scantip:SetHyperlink(link)
for i=2, scantip:NumLines() do -- can skip first line since it's just the item name.. or not. up to you
local text = _G["MyScanningTooltipTextLeft"..i]:GetText())
-- do stuff with text
end
end
You can get a better idea as to what it's doing by mousing over an item in game and using:
/script for i=1, GameTooltip:NumLines() do print(_G["GameTooltipTextLeft"..i]:GetText()) end
Hopefully I'm getting the premise of your intent correct 0_o.