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

How to configure Chromedriver to take '--whitelisted-ips=""' to allow remote connections #128

Open
phuang07 opened this issue Jun 11, 2021 · 2 comments

Comments

@phuang07
Copy link

I am running arsenic within docker with chromedriver, but it complains:

docker@75fbccca7ba8:/docs$ python test.py 0 2

Starting ChromeDriver 91.0.4472.19 (1bf021f248676a0b2ab3ee0561d83a59e424c23e-refs/branch-heads/4472@{#288}) on port 53603
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1623448645.578][SEVERE]: bind() failed: Cannot assign requested address (99)
ChromeDriver was started successfully.

my code looks like this:

    # try chrome
    service = services.Chromedriver()
    browser = browsers.Chrome(chromeOptions={
        'args': ['--headless', '--disable-gpu', '--whitelisted-ips=""', '--no-sandbox','--disable-dev-shm-usage']
    })

But that doesn't work. Is there a way we can configure the --whitelisted-ips option for the Chromedrive via code?

@dimaqq
Copy link
Contributor

dimaqq commented Jun 12, 2021

I tried to read https://bugs.chromium.org/p/chromedriver/issues/detail?id=780 but I can't be sure if they mean --whitelisted-ips="" verbatim or --whitelisted-ips="" typed in the shell which ought to result in --whitelisted-ips= passed to chromedriver.
Also, that ticket is 6 years old, things could have changed.
May I suggest that you try starting chromedriver manually, from another terminal with different values for this flag to see what may actually work?

@dimaqq
Copy link
Contributor

dimaqq commented Jun 12, 2021

Given this bit:

233         "whitelisted-ips", "comma-separated whitelist of remote IPv4 addresses "
234             "which are allowed to connect to ChromeDriver",

I think that the double-quotes should not be passed to chromedriver.
Thus, please try [..., '--whitelisted-ips=', ...] ...

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