The Artima Developer Community
Sponsored Link

Perl Buzz Forum
Test::WWW::Mechanize adds scraping functions

0 replies.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a flat view of this topic  Flat View
Previous Topic   Next Topic
Threaded View: This topic has 0 replies on 1 page
Andy Lester

Posts: 518
Nickname: petdance
Registered: Jun, 2009

Andy Lester is an author and programmer.
Test::WWW::Mechanize adds scraping functions Posted: Apr 13, 2012 2:14 PM
Reply to this message Reply

This post originated from an RSS feed registered with Perl Buzz by Andy Lester.
Original Post: Test::WWW::Mechanize adds scraping functions
Feed Title: Perlbuzz
Feed URL: http://perlbuzz.com/atom.xml
Feed Description: What's happening in the world of Perl programming, including Perl 5, Perl 6, the CPAN and Parrot?
Latest Perl Buzz Posts
Latest Perl Buzz Posts by Andy Lester
Latest Posts From Perlbuzz

The new 1.40 release of Test::WWW::Mechanize adds functions to help scrape text from your HTML as you test it. This should make things much easier for your integration test of your web apps.

For example, if you want to make sure that this shows up:

<h1>My awesome page!</h1>

then you can add an id attribute to the <h1>

<h1 id="pagetitle">My awesome page!</h1>

and your test can check for it:

$mech->scraped_id_is( 'pagetitle', 'My Awesome Page!' );

Two other functions are added to help in your text extraction: ->scrape_text_by_id() and ->scrape_text_by_attr().

Will these functions help your testing? Do you have other methods that you use to aid testing? As always, I welcome your feedback.

Read: Test::WWW::Mechanize adds scraping functions


Topic: Perlbuzz news roundup for 2012-04-16 Previous Topic   Next Topic Topic: Perlbuzz news roundup for 2012-04-09

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use