Trace On has asked for the wisdom of the Perl Monks concerning the following question:
Hi wiseguys,
can I (better: how can I) use regex with web::scraper?
my html looks like this:
# <div class="ereignis " style="55;" data-type="link" data-content= +"/ajax/ereignis/185" rel="tooltip"> # <span class="point"> # # </span> # </div> <code> My scraper looks (so far like this): <code> my $scraper = scraper { "styles[]" => scraper { process 'div[data-content[contains("/ajax/ereignis")]]', "styles[] +" => scraper { process 'span', "ereignis" => '@class'; process 'div[style]', "zeit" => '@style'; } }; my $res = $scraper->scrape($html); print Dumper $res;
The "contains"-part is wrong... What would work is:
div[data-content="/ajax/ereignis/185"]But that would only give me a single "ereignis" and not all.
I am grateful for any ideas!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: web::scraper and regex
by Corion (Patriarch) on Sep 07, 2015 at 08:23 UTC | |
by Anonymous Monk on Sep 07, 2015 at 08:34 UTC | |
by Corion (Patriarch) on Sep 07, 2015 at 08:39 UTC | |
|
Re: web::scraper and regex
by Anonymous Monk on Sep 07, 2015 at 07:56 UTC | |
by Anonymous Monk on Sep 07, 2015 at 08:19 UTC |