mirror of
https://github.com/TangentFoxy/lua-htmlparser.git
synced 2025-07-28 11:02:18 +00:00
incomplete test for extraxting microdata
See -- TODO
This commit is contained in:
16
test.lua
16
test.lua
@@ -74,5 +74,21 @@ for k,v in pairs(contacts) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
print("\nmicrodata")
|
||||||
|
local sel, scopes = root("[itemscope]"), {}
|
||||||
|
for i,v in ipairs(sel.nodes) do
|
||||||
|
local type = v.attributes["itemtype"]
|
||||||
|
if not v.attributes["itemprop"] then
|
||||||
|
scopes[type] = scopes[type] or {}
|
||||||
|
local item = {}
|
||||||
|
local sel = sel("[itemprop]")
|
||||||
|
for i,v in ipairs(sel.nodes) do
|
||||||
|
-- TODO
|
||||||
|
print("prop", v.attributes["itemprop"])
|
||||||
|
end
|
||||||
|
table.insert(scopes[type], item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user