in reply to web::scraper and regex

Web::Scraper resp. the underlying HTML::Selector::XPath doesn't understand XPath regular expressions - they came in with XPath version 2.0 which it doesn't support. The correct syntax for a contains() query would be:

div[contains(@data-content, "/ajax/ereignis")]

If that helps you already then that's it, otherwise you'll have to add some postprocessing in Perl.

Replies are listed 'Best First'.
Re^2: web::scraper and regex
by Anonymous Monk on Sep 07, 2015 at 08:34 UTC

      I'm sorry I was unclear - I didn't expect regular expressions but most of the time I'm content with matching substrings.

      I have to reinvestigate how to use Perl regular expressions in HTML::Selector::XPath and how these could be passed on downwards to HTML::TreeBuilder::XPath, thanks!