Xpath example?
Closed this issue · 2 comments
peyloride commented
Hello thanks for your hard work. Is there any find by xpath example? I cant find.
Also how can I find subtags under a tag? For example there is six td tag under tr tag; I want to select them and read its content.
Thanks!
gbetsan commented
I prefer to use CSS selectors:
doc.css("tr td") do |td|
...
end
madeindjs commented
For xpath, you should directly use XML::Node
in standard librairy. You can find some examples in Crystal Documentation.
About you CSS query, @grig191 's answer seem good .