Issue
I tried scraping books from Daraz in the scrapy shell but I don't get anything.
link: Daraz
This is the result I get:
In [90]: response.css('#root > div > div.ant-row.c10-Cg > div:nth-child(1) > div > div.ant-col-20.ant-col-push-4.c1z9Ut
...: > div.c1_t2i > div:nth-child(1) > div > div > div.c3KeDq > div.c16H9d > a::text').getall()
Out[90]: []
Solution
Daraz is a dynamically generated website. Meaning, that some items are only generated when an actual browser opens the website.
When you make get request from within your python file, you only get the skeleton of where the items are supposed to go, but not the actual items, so it will not recognise the class name you send.
If you are a beginner, I recommend you use Selenium to scrape dynamically generated websites.
Answered By - Mukul Aryal
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.