Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote webdriver not working #94

Open
nareto opened this issue Apr 21, 2021 · 5 comments
Open

Remote webdriver not working #94

nareto opened this issue Apr 21, 2021 · 5 comments

Comments

@nareto
Copy link

nareto commented Apr 21, 2021

I have a docker container running selenium-chrome (the "standalone-chrome" official container) and I'm trying to get scrapy-selenium to work with it. I have this in settings.py:

DOWNLOADER_MIDDLEWARES = {
      'scrapy_selenium.SeleniumMiddleware': 800
}
SELENIUM_DRIVER_NAME = 'chrome'
SELENIUM_COMMAND_EXECUTOR='http://localhost:4444/wd/hub' 
SELENIUM_DRIVER_ARGUMENTS=['--headless']  

and I tried different combinations, but I keep getting

[scrapy.middleware] WARNING: Disabled SeleniumMiddleware: SELENIUM_DRIVER_NAME and SELENIUM_DRIVER_EXECUTABLE_PATH must be set

I don't think SeleniumRequest is working, I get further down a KeyError for 'screenshot' on response.meta (I did set screenshot=True in SeleniumRequest).

The selenium container is indeed working, it works if I test it by passing it to webdriver.Remote. Any suggestions?

@WaterKnight1998
Copy link

@nareto did you solve it?

@nareto
Copy link
Author

nareto commented May 1, 2021

No. I hadn't noticed the project is not maintained anymore. I am now trying to use scrapy-splash but having other problems. It's a pity because in my limited experience Selenium works better than Splash

Maybe I'll come back to this and not use the remote webdriver, but this makes it harder to dockerize the scraper.

@rohitsathish
Copy link

Having the same issue.

@shijialee
Copy link

shijialee commented Jun 15, 2021

Remote selenium driver doesn't work in version 0.7. For testing, replace middleware.py with the one from latest commit. Also, use SELENIUM_DRIVER_ARGUMENTS=['-headless'] for remote chrome driver.

@hyobbb
Copy link

hyobbb commented Jul 1, 2021

I have the same issue so I am using selenium directly and there's no problem at all that is.. it doesn't make sense of using this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants