Disable proxy via Python for Selenium with headless Chrome

Joern Boegeholz

I'm using Chrome with Selenium in Python 2.7.

I've tried to run Chrome in headless mode but it slows down my tests significantly.

One workaround shall be to disable the proxy settings but I don't know how to do it in python.

This is my code so far:

from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--disable-extensions")
chrome_options.add_argument('headless')
chrome_options.add_argument('--hide-scrollbars')
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('???') # which option?
self.driver = webdriver.Chrome("C:\Python27\Scripts\chromedriver.exe", chrome_options=chrome_options)

Does anyone know how to solve this?

Alexey Dolgopolov

Try this:

chrome_options.add_argument('--no-proxy-server')

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do you run headless chrome and a proxy using selenium in python?

Chrome Options in Python Selenium : Disable GPU vs Headless

python proxy in selenium firefox headless not working

Selenium: Disable headless when code is running? (Python)

selenium python chrome headless mode unsupported

--headless is not an option in chrome webdriver for selenium python

Scrapyng AngularJS with Selenium in Python in Chrome headless mode

Downloading with chrome headless and selenium

Selenium/WebdriverIO Chrome headless?

Detected on Headless Chrome Selenium

Selenium working with Chrome, but not headless Chrome

Getting '403 Forbidden' error when using headless chrome with python selenium

Chrome is stuck in mobile version while running headless mode in Selenium Python

TimeoutException using Google Chrome in headless mode through Python Selenium

Accessing a website behind a proxy server with Google Chrome headless, using Selenium, which works when using Fiddler

Running Selenium with Headless Chrome Webdriver

Selenium tests execution in headless chrome

Python Selenium Headless download

Disable image load in Chrome with Selenium in Python

Disable Chrome Notifications using Selenium Python

Chrome headless browser with corporate proxy authetication not working

Access Denied page with headless Chrome on Linux while headed Chrome works on windows using Selenium through Python

CPU throttling in chrome via python selenium

Clicking button via python selenium chrome

Disable Chrome notifications (Selenium)

headless option not working selenium python

Sending keys using Selenium and headless Chrome

Cannot create account in Selenium with Headless Chrome Driver

Headless chrome cannot detect elements(selenium)