Skip to content

Instantly share code, notes, and snippets.

@lalinsky
Created July 13, 2010 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lalinsky/474525 to your computer and use it in GitHub Desktop.
Save lalinsky/474525 to your computer and use it in GitHub Desktop.
my $tree = HTML::TreeBuilder::XPath->new;
$tree->parse_content($response->content);
my @elements = $tree->findnodes("//div[id='foo']");
my $content = @elements > 0 ? $elements[0]->as_HTML : '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment