Eagerod / html-cruncher

HTML parser
MIT License
0 stars 0 forks source link

Uniqueness in XPath #25

Closed Eagerod closed 8 years ago

Eagerod commented 8 years ago

Looks like something to the tune of //div//img will duplicate all img elements for each div they're nested in.

<div>
  <div>
    <img src='/a.png' />
  </div>
</div>

When run through XPath:

element.xpath("//img").length
> 1
element.xpath("//div//img").length
> 2