diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-16 16:10:36 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-16 16:10:36 +0100 |
commit | 48e1e41ac938333a2f883e03873723e66c55fb40 (patch) | |
tree | 459d23c8d0379fe7d980e6bc2561fe23a85fe5ec /perllib/FixMyStreet/TestMech.pm | |
parent | 716245446164f70fb1ab324f292e8fd21810f6b2 (diff) |
add method to extract meta information from problem report page
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r-- | perllib/FixMyStreet/TestMech.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm index 160b3955a..9f6b50a3e 100644 --- a/perllib/FixMyStreet/TestMech.pm +++ b/perllib/FixMyStreet/TestMech.pm @@ -288,6 +288,26 @@ sub extract_location { }; } +=head2 extract_problem_meta + + $meta = $mech->extract_problem_meta; + +Returns the problem meta information ( submitted by, at etc ) from a +problem report page + +=cut + +sub extract_problem_meta { + my $mech = shift; + + my $result = scraper { + process 'div#side p em', 'meta', 'TEXT'; + } + ->scrape( $mech->response ); + + return $result->{meta}; +} + =head2 visible_form_values $hashref = $mech->visible_form_values( ); |