wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.9k stars 254 forks source link

'Options' object has no attribute 'set_capability' #553

Closed davuses closed 2 years ago

davuses commented 2 years ago

Packages version is:

selenium==3.14.0              
selenium-wire==4.6.4   

The traceback info is:

Traceback (most recent call last):
  File "/home/kiu/python/temp/test.py", line 365, in run
    browser = webdriver.Chrome(options=chrome_options)
  File "/home/kiu/.local/lib/python3.8/site-packages/seleniumwire/webdriver.py", line 209, in __init__
    chrome_options.set_capability(key, value)
AttributeError: 'Options' object has no attribute 'set_capability'

Code:

from seleniumwire import webdriver

proxy = "127.0.0.1:10108"
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--proxy-server=%s" % proxy)

browser = webdriver.Chrome(options=chrome_options)

The README page says Compatible Selenium version is 3.4.0+ , I am not sure if this is to do with selenium version.

512 , this issue also mentioned this problem.

wkeeling commented 2 years ago

Thanks for raising this. It seems to be a legitimate compatibility issue with the 3.14.0 version. A fix is on the way.

davuses commented 2 years ago

@wkeeling Thank you!