mirror of
https://github.com/msva/lua-htmlparser.git
synced 2024-11-04 23:34:20 +00:00
incomplete test for extraxting microdata
See -- TODO
This commit is contained in:
parent
82dbddfd19
commit
78d99a61f6
16
test.lua
16
test.lua
@ -74,5 +74,21 @@ for k,v in pairs(contacts) do
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user