wkeeling / selenium-wire

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

ImportError: cannot import name 'EdgeOptions' #650

Closed Programmeurke closed 1 year ago

Programmeurke commented 1 year ago

Hi I'm running a python flask app, which gave me the following error. I was able to solve it by commenting the line from selenium.webdriver import EdgeOptions inside webdriver.py

ERROR MESSAGE: (venv) root@xxxxxxxx/home/ubuntu/MyProject# flask run

Error: While importing 'app', an ImportError was raised:

Traceback (most recent call last): File "/home/ubuntu/venv/lib/python3.6/site-packages/flask/cli.py", line 260, in locate_app import(module_name) File "/home/ubuntu/MyProject/app/init.py", line 141, in from app import routes, models, errors, cli File "/home/ubuntu/MyProject/app/cli.py", line 2, in from app.scheduled import MyProjectscheduled_hourly, MyProjectscheduled_minutely, MyProjectscheduled_daily File "/home/ubuntu/MyProject/app/scheduled.py", line 2, in from pageManager.pageManager import runQueries, scanSitesParallel, archiveOldPages, resetExistingPages, extractNewPages, getNewCompletes, \ File "/home/ubuntu/MyProject/pageManager/pageManager.py", line 23, in from pageManager.webFunctions import downloadPage, getLinksFromPage, filterLinks, downloadPageImmoweb File "/home/ubuntu/MyProject/pageManager/webFunctions.py", line 19, in from seleniumwire.webdriver import Chrome as ChromeWithProxy File "/home/ubuntu/venv/lib/python3.6/site-packages/seleniumwire/webdriver.py", line 23, in from selenium.webdriver import EdgeOptions ImportError: cannot import name 'EdgeOptions'

OPERATING SYSTEM cat /etc/os-release NAME="Ubuntu" VERSION="18.04.6 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.6 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

PYTHON PACKAGES pip3 list Package Version


alembic 1.5.6 amqp 5.1.1 appdirs 1.4.4 APScheduler 3.7.0 arabic-reshaper 2.1.3 attrs 21.4.0 Babel 2.9.0 bcrypt 3.2.0 beautifulsoup4 4.9.3 billiard 3.6.4.0 blinker 1.4 boto3 1.17.55 botocore 1.20.55 Brotli 1.0.9 bs4 0.0.1 cached-property 1.5.2 celery 5.1.2 certifi 2020.12.5 cffi 1.15.1 chardet 4.0.0 click 8.0.4 click-didyoumean 0.3.0 click-plugins 1.1.1 click-repl 0.2.0 consonance 0.1.2 Crawl 0.5.5 cryptography 38.0.4 cssselect2 0.4.1 cycler 0.11.0 dataclasses 0.8 dissononce 0.34.3 dnspython 2.0.0 email-validator 1.1.2 Flask 2.0.3 Flask-API 2.0 Flask-Assets 2.0 Flask-Babel 2.0.0 Flask-Login 0.5.0 Flask-Mail 0.9.1 Flask-Migrate 2.7.0 Flask-Moment 0.11.0 Flask-Script 2.0.6 Flask-SQLAlchemy 2.4.4 Flask-WTF 1.0.1 fonttools 4.27.1 future 0.18.2 greenlet 1.0.0 gunicorn 20.1.0 h11 0.13.0 h2 4.1.0 hpack 4.0.0 html5lib 1.1 http-ece 1.1.0 hyperframe 6.0.1 idna 2.10 importlib-metadata 4.8.3 iniconfig 1.1.1 intervaltree 3.1.0 itsdangerous 2.0.1 Jinja2 3.0.3 jmespath 0.10.0 joblib 1.0.1 kaitaistruct 0.10 kiwisolver 1.3.1 kombu 5.1.0 lxml 4.6.2 Mako 1.1.4 MarkupSafe 2.0.1 matplotlib 3.3.4 mollie-api-python 2.9.1 numpy 1.19.5 oauthlib 3.1.1 packaging 21.3 pandas 1.1.5 paramiko 2.8.0 phonenumbers 8.12.20 Pillow 8.4.0 pip 21.3.1 pkg_resources 0.0.0 pluggy 1.0.0 prompt-toolkit 3.0.29 protobuf 3.14.0 psutil 5.9.1 psycopg2-binary 2.8.6 py 1.11.0 py-vapid 1.8.1 pyasn1 0.4.8 pycparser 2.21 pydyf 0.1.2 PyJWT 2.0.1 PyMySQL 1.0.2 PyNaCl 1.4.0 pyOpenSSL 22.0.0 pyparsing 3.0.6 PyPDF2 1.26.0 pyphen 0.11.0 pyshp 2.3.0 PySocks 1.7.1 python-axolotl 0.2.2 python-axolotl-curve25519 0.4.1.post2 python-bidi 0.4.2 python-dateutil 2.8.1 python-dotenv 0.15.0 python-editor 1.0.4 pytz 2022.1 pywebpush 1.13.0 rabbitmq 0.2.0 reportlab 3.6.7 requests 2.25.1 requests-oauthlib 1.3.0 s3transfer 0.4.1 scikit-learn 0.24.2 scipy 1.5.4 seaborn 0.11.2 selenium 3.141.0 selenium-wire 5.0.0 setuptools 39.0.1 six 1.15.0 sklearn 0.0 sortedcontainers 2.3.0 soupsieve 2.2 SQLAlchemy 1.3.20 suds 1.0.0 tenacity 6.2.0 threadpoolctl 3.0.0 tinycss2 1.1.1 transitions 0.8.8 typing-extensions 3.10.0.0 tzlocal 2.1 urllib3 1.26.3 uWSGI 2.0.19.1 v 0.0.0 vine 5.0.0 wcwidth 0.2.5 weasyprint 54.1 webassets 2.0 webencodings 0.5.1 Werkzeug 2.0.0 wheel 0.36.2 wsproto 1.0.0 WTForms 2.3.3 xhtml2pdf 0.2.5 zipp 3.4.1 zopfli 0.1.9 zstandard 0.19.0

g-bo-wen commented 1 year ago

The selenium that selenium-wire depends on requires python >= 3.7

Programmeurke commented 1 year ago

Thanks!