This is meant to provide a canonical Q&A to all that similar (but much too specific questions to be a close target candidate) popping up once or twice a week.
I'm developing an application that needs to parse a website with tables in it. As deriving XPath expression for scraping web pages is boring and error-prone work, I'd like to use the XPath extractor feature of Firebug (or similar tools in other browsers) for this.
Example input looks like this:
<!-- snip --> <table id="example"> <tr> <th>Example Cell</th> <th>Another one</th> </tr> <tr> <td>foobar</td> <td>42</td> </tr> </table> <!-- snip -->
I want to extract the first data cell ("foobar"). Firebug proposes the XPath expression
which works fine in any XPath tester plugins, but not my own application (no results found). If I cut down the query to
//table[@id], it works again.
What's going wrong?