5

i am web scraping using scrapy and selenium webdrivers. But i find selenium webdriver to be very slow, but i find it easier to extract CSS properties of a webelement eg.

webElement.value_of_css_property('font-size')

how can this be achieved using scrapy only and no selenium webdriver.

1 Answer 1

1

For this you have to have a rendered content in a real browser. Scrapy downloader is not a browser and has only the initial HTML page, there is no javascript engine built-in and it cannot download additional CSS or JS files.

With Scrapy you can only get the style attribute value of an element, but nothing more than that. selenium is the tool for the job.

Note that you can avoid having a real display as a dependency and automate phantomjs headless browser or other browsers in a virtual display.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.