I'm learning XPath for web scraping and stumbled across these two XPath examples:
//div[@class="head"][@id="top"]
and
//div[@class='canvas- graph']//a[@href='/accounting.html'][i[@class='icon-usd']]/following-sibling::h4
I wonder what does the div[@class="head"][@id="top"] mean. Does it mean that the @id=top property belongs to the div element? Is it the same as //div[@class="head" and @id="top"]?
And what does it mean when square brackets are nested inside another as in the second example?
What would the HTML DOM look like for the second xpath expression to match it?