diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-16 16:40:50 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-16 16:40:50 +0100 |
commit | b6c9caf3d3925ab32d6a207754cfbe5979fb218f (patch) | |
tree | 800b6d01ca87f05cd047ae97c2e59cdac02e895e /perllib/FixMyStreet/TestMech.pm | |
parent | 19bd438d52aa3f0bd707a899025b38eb9d4f27c4 (diff) |
method to extract problem title
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index 9f6b50a3e..0965ff49c 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -308,6 +308,25 @@ sub extract_problem_meta { return $result->{meta}; } +=head2 extract_problem_title + + $title = $mech->extract_problem_title; + +Returns the problem title from a problem report page + +=cut + +sub extract_problem_title { + my $mech = shift; + + my $result = scraper { + process 'div#side h1', 'title', 'TEXT'; + } + ->scrape( $mech->response ); + + return $result->{title}; +} + =head2 visible_form_values $hashref = $mech->visible_form_values( ); |