Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrapy:: How to use "not" in CSS selector to skip elements

Is there anyway to use such selector in scrapy?

I tried following but getting index out of range error

response.css('.breadcrumbs > ul > li:not[class^="home"]').extract()

like image 804
Volatil3 Avatar asked Dec 14 '22 01:12

Volatil3


1 Answers

You should enclose not expression in brackets like this

response.css('.breadcrumbs > ul > li:not([class^="home"])').extract()
like image 109
mizhgun Avatar answered May 21 '23 16:05

mizhgun