KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm just starting out in Perl, and wrote a simple script to do some web scraping. I'm using WWW::Mechanize and HTML::TreeBuilder to do most of the work, but I've run into some trouble. I have the following HTML: <table class="winsTable"> <thead>...</thead> <tbody> <tr> <td class = "wins">15</td> </tr> </tbody> </table> I know there are some modules that get data from tables, but this is a special case; not all the data I want is in a table. So, I tried: my $tree = HTML::TreeBuilder->new_from_url( $url ); my @data = $tree->find('td class = "wins"'); But @data returned empty. I know this method would work without the class name, because I've successfully parsed data with $tree->find('strong') . So, is there a module that can handle this type of HTML syntax? I scanned through the HTML::TreeBuilder documentation and didn't find anything that appeared to, but I could be wrong.
Tags (comma-separated)
Save Edits
Cancel