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

ImportError: cannot import name 'EdgeOptions' from 'selenium.webdriver' #17

Open
howff opened this issue Mar 25, 2023 · 6 comments
Open

Comments

@howff
Copy link

howff commented Mar 25, 2023

After installing the required dependencies: python gbd.py gives the error:

Traceback (most recent call last):
  File "google-books-downloader\gbd.py", line 6, in <modu
le>
    from seleniumwire import webdriver
  File "Python310\site-packages\seleniumwire
\webdriver.py", line 23, in <module>
    from selenium.webdriver import EdgeOptions
ImportError: cannot import name 'EdgeOptions' from 'selenium.webdriver' (Python310\site-packages\selenium\webdriver\__init__
.py)
@Antitrack
Copy link

Same here:

$ python3 gbd.py
Traceback (most recent call last):
File "gbd.py", line 6, in
from seleniumwire import webdriver
File "/home/att/.local/lib/python3.6/site-packages/seleniumwire/webdriver.py", line 23, in
from selenium.webdriver import EdgeOptions
ImportError: cannot import name 'EdgeOptions'

@SrGeneroso
Copy link

The same for me, using WSL

@duffy6
Copy link

duffy6 commented Mar 23, 2024

Same here

@ur817320
Copy link

Did anyone find a resolution?

@manavortex
Copy link

You need selenium >= 4.x, but not too much newer, otherwise you'll get an error when initializing webdriver:

pip install selenium==4.0.0  

After that, I ran into another error: module 'lib' has no attribute 'X509_V_FLAG_NOTIFY_POLICY'
... which I resolved by updating more packages:

py pip install selenium-wire --upgrade
pip install blinker==1.7.0
pip install pyopenssl --upgrade  

After that, I ran into ModuleNotFoundError: No module named 'pkg_resources'
... so I installed setuptools:

pip install setuptools  

After that, I only needed to install chrome and make sure that the executable was on my %PATH%.

Next, I ran into another exception: session not created: This version of ChromeDriver only supports Chrome version 83
So I hit up the chromedriver website and installed the correct version for my Chrome, which I did by extracting the executable into the same directory containing gbd.py.

Piece of cake, basically!

Jokes aside: Thank you for writing this :)

@JoseDeFreitas
Copy link

I can't thank you enough, @manavortex. Works perfectly after doing what you suggested. Have a great day 😄.

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

7 participants