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

Chrome headless mode isn't working #115

Open
shengyilu opened this issue May 1, 2022 · 1 comment
Open

Chrome headless mode isn't working #115

shengyilu opened this issue May 1, 2022 · 1 comment

Comments

@shengyilu
Copy link

I followed the instruction to edit settings.py as :

SELENIUM_DRIVER_NAME = 'chrome'
SELENIUM_DRIVER_EXECUTABLE_PATH = '/Users/****/chromedriver'
SELENIUM_DRIVER_ARGUMENTS=['--headless']

However, the Chrome will be launched every time I run the spider.
BTW, with only Selenium, headless mode was working correctly:
options = Options()
options.add_argument("--headless")
driver = webdriver.Chrome(service = Service(ChromeDriverManager().install()), options = options)

Does anyone face the same problem? Need some help.

@deduble
Copy link

deduble commented Jun 13, 2022

from shutil import which
ChromeDriverManager().install() also downloads and returns path. so this was working for me

SELENIUM_DRIVER_NAME = 'chrome'
SELENIUM_DRIVER_EXECUTABLE_PATH = which(ChromeDriverManager().install())
SELENIUM_DRIVER_ARGUMENTS=['--headless']

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

2 participants