Sunday, 16 December 2018

Is it possible to locate elements by CSS properties in Scrapy?

Am wondering if python scrappy has methods to scrape data based on their colors defined in CSS. For example, select all elements with background-color: #ff0000.

I have tried this:

response.css('td::attr(background-color)').extract()

I was expecting a list with all background colors set for the table data elements but it returns an empty list.

Is it generally possible to locate elements by their CSS properties in Scrapy?



from Is it possible to locate elements by CSS properties in Scrapy?

No comments:

Post a Comment