zytedata / zyte-smartproxy-selenium

A wrapper over Selenium Wire to provide Zyte Smart Proxy Manager specific functionalities.
3 stars 4 forks source link

Q: Use of Chrome Options #1

Closed iDevo closed 2 years ago

iDevo commented 2 years ago

Hi there, thank you for the amazing update, it is way easier now then ever before!

Quick question. I would like to use ChromeOptions in order to configure the web driver but receive an error that this attribute does not exist.

AttributeError: module 'zyte_smartproxy_selenium.webdriver' has no attribute 'ChromeOptions'

My code looks like this:

from zyte_smartproxy_selenium import webdriver 

options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--lang=en')
options.add_argument("--no-sandbox")
options.add_argument('--window-size=1920,1080')
options.add_argument("user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15")
options.add_experimental_option('prefs', {'intl.accept_languages': 'en,en_US'})
options.add_argument('--disable-blink-features=AutomationControlled')
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument("--disable-blink-features")

browser = webdriver.Chrome(spm_options={'spm_apikey': 'KEY'})   // here I would like to pass my options
browser.get('https://google.com')
browser.close()

Again thank you very much for your great work with this library!

Niklas

geronsv commented 2 years ago

Thanks for reporting @iDevo We've added ChromeOptions. Try upgading: python3 -m pip install --upgrade zyte-smartproxy-selenium

iDevo commented 2 years ago

Great support! Thank you very much!