Reputation: 43
This tutorial helped me in order to gather the first drop down list entries on a website. But I am not able to get the data of the second conditional/dependent drop down box with Scrapy.
Assuming the following procedure is the way to go, how does step 2 work? The values never appear so far...
I think the code below needs to be adjusted as the code is for a submit form:
for i in range(len(brandCategoryList)):
# Generate new request for each brand category's page
yield FormRequest("http://www.xxxxxxxxxx.com",
method='POST',
formdata={'BrandName':'','CatBrand':brandCategoryList[i],'submit1':'Find+Product'},
callback=self.parseBrandPage,
meta={'brandCategoryId':i,'brandCategoryName':brandCategoryList[i]})
Thanks
Upvotes: 4
Views: 2406
Reputation: 745
Scrapy won't run any javascript code in the page you are scraping, and dependent drop-downs often rely on javascript to populate their options based on the choice in their controlling drop-down.
If you need to automate/scrape content which requires javascript, you may want to consider another library. Start here for some pointers.
Upvotes: 2