question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot import webdriver with selenium > 4.1.0

See original GitHub issue

It looks like the selenium release 4.1.1 breaks selenium-wire. I get the following error when importing webdriver:

ImportError                               Traceback (most recent call last)
Input In [1], in <module>
----> 1 from seleniumwire import webdriver

File /opt/homebrew/Caskroom/miniforge/base/envs/selenium/lib/python3.10/site-packages/seleniumwire/webdriver.py:14, in <module>
     12 from selenium.webdriver import FirefoxProfile  # noqa
     13 from selenium.webdriver import Proxy  # noqa
---> 14 from selenium.webdriver import TouchActions  # noqa
     15 from selenium.webdriver import Chrome as _Chrome
     16 from selenium.webdriver import ChromeOptions, DesiredCapabilities

ImportError: cannot import name 'TouchActions' from 'selenium.webdriver' (/opt/homebrew/Caskroom/miniforge/base/envs/selenium/lib/python3.10/site-packages/selenium/webdriver/__init__.py)

All is well with selenium 4.1.0.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
wkeelingcommented, Feb 25, 2022

Fixed in Selenium Wire v4.6.2

2reactions
cw-kbra-10887commented, Feb 24, 2022

I rolled back to selenium 3.141, I needed it working right away. I would submit a PR to remove TouchActions, but I don’t know the full scope of what would break if I did it

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ Bug]:Py version 4.1.1 can't find the path. Look at ... - GitHub
What happened? from selenium.webdriver import TouchActions, ... Cannot import webdriver with selenium > 4.1.0 wkeeling/selenium-wire#513.
Read more >
cannot import name 'remote_connection' from 'selenium ...
You cannot import webdriver and remote using from selenium.webdriver.chrome import service, webdriver, remote_connection as detailed in the ...
Read more >
Upgrade to Selenium 4
These are the steps we will follow to upgrade to Selenium 4: Preparing our test code ... from selenium import webdriver options =...
Read more >
How to solve "Webdriver cannot be resolved to a type" Error in ...
In this video it shows how one can resolve the " Webdriver cannot be resolved to a type" error while working with selenium...
Read more >
import org openqa selenium shows compilation error - Edureka
Either keep only selenium-server-standalone-3.141.59. · Or keep only selenium-java-3.141.59 JARs as an external JARs. · Remove all the other ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found