Skip to content

Passing URL to parse in Scrapy Spider URL is captured using Scrapy-Selenium #81

Open
@Mathoholic

Description

@Mathoholic

I am trying to scrape a website which has some dropdowns, So I planned to use Scrapy Framework with Scrapy-Selenium(more here) to click around the dropdowns(Nested For loop) and then capture the URL using below code and pass it to the parse() function to look for the needed data and scrape it to MySQL Database.

now_url=self.driver.current_url

 print('Current URL is:'+now_url)
 yield Request(now_url,callback=self.parse)
            

def parse(self, response):
    
#This Function Will Loop though Each Page and Capture the Data Sets Available on Each Page of Medicine

#creating items to be stored in itemspy file with this Crawler: 

items=GrxItem()

#loop around the items on each medicine page(from a-z) and add them to items and throw into pipelines to SQL DB

But the logics seems not working as expected. Any insight to deal with this is appreciated. The full code is here.

EDIT: I tried using SeleniumRequest() as well but it seems that too is not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions