Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with findall #175

Open
healyp opened this issue Jul 27, 2022 · 0 comments
Open

problem with findall #175

healyp opened this issue Jul 27, 2022 · 0 comments

Comments

@healyp
Copy link

healyp commented Jul 27, 2022

Perhaps I'm not using findall() correctly but I get the following behavior that, to me, is strange:

julia> c118=r; c118c1=elements(c118)[1]; println(c118c1)
<td>1911<br/><small> <sup class="reference" id="ref_anone"><a href="#endnote_anone">[a]</a></sup><br/><small><i><a href="/wiki/1911_All-Ireland_Senior_Hurling_Championship_Final" title="1911 All-Ireland Senior Hurling Championship Final">Details</a></i></small>
</small></td>
julia> links = findall("//i/a[@href]", c118c1)
137-element Vector{EzXML.Node}:
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003c66900>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003faf6d0>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003615020>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003906120>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003fe27c0>)
 ⋮
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003789b40>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003f66980>)
 EzXML.Node(<ELEMENT_NODE[a]@0x0000000003f82600>)

julia> 

All hrefs in the entire tree are picked up whereas I would only have expected the single href in the c118c1 sub-tree.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant