Skip to content

missing 1 required positional argument: 'url' #20

@1quintana

Description

@1quintana

Hello I followed the installation guide, but I am having the next error. I am using python 3.7.0

    yield SeleniumRequest(url, self.parse)
  File "/usr/local/lib/python3.7/site-packages/scrapy_selenium/http.py", line 29, in __init__
    super().__init__(*args, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'url'

I added to the settings the next configuration

from shutil import which
SELENIUM_DRIVER_NAME='chrome'
SELENIUM_DRIVER_EXECUTABLE_PATH=which('geckodriver')
SELENIUM_DRIVER_ARGUMENTS=['-headless']  # '--headless' if using chrome instead of firefox

here is my code

def start_requests(self):
      url = "http://egov.sos.state.or.us/br/pkg_web_name_srch_inq.do_name_srch?p_name=aa&p_regist_nbr=&p_srch=PHASE3P&p_print=FALSE&p_entity_status=ACTINA"
      yield SeleniumRequest(url, self.parse)

def parse(self, response):
   rows = response.selector.xpath("//table/tbody/tr")

One more tip, if I use the next way to implement selenium is working with no problem.

chromedriver = os.getcwd()+'/leadsScraper/chromedriver'
driver = webdriver.Chrome(chromedriver)
delay = 10

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