I want to extract img src attribute value if the value contains "foo.gif" using scrappy module with Scrappy::Scraper::Parser.So I used CSS sub string selector as following
Use Scrappy; $html=" <h1>ARCO ELETRÔNICO - MUSICAL - D63 - TINY LOVE</h1> </a>Este arco é colorido, flexível e versátil. Pode ser +colocado para diversão do Bebê no carrinho e no bebê conforto.</p> <img src="http://www.somesite.com/site/_images/image1.gif" /> <br /><img src="http://www.somesite.com/site/_images/foo +.gif" /><br /> "; my $parser = Scrappy::Scraper::Parser->new; $parser->html($html); $parser->select('img[src*="foo.gif"]'); my $image_url = $parser->data->[0]->{src}; print "\nimage:$image_url\n";
But it doesn't fetch the foo.gif url by matching substring .
In reply to Substring matching attribute selector is not working in Scrappy module by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |