python 3.10.1
selenium 4.4.3
Old version Package:
from selenium import webdriver
New version Package:
from selenium import webdriver from selenium.webdriver.common.by import By
You need to import one more, otherwise the ‘By’ will report an error
Positioning statement
drive.find_element(By.NAME,"username").send_keys("astudy")
Read More:
- [Solved] Python Selenium Error: AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
- [Solved] AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Solved] Python serializate error: NameError: name ‘JSON’ is not defined
- Python error collection: NameError: name ‘numpy’ is not defined
- Python parsing JSON Error: NameError: name ‘false’ is not defined
- Chromdriver Install error: File “C:\python37\lib\site-packages\selenium\webdriver\common\service.py”, line 76, in start stdin=PIPE) File…
- NameError: name ‘xrange‘ is not defined [How to Solve]
- NameError: name “defaultParams“ is not defined [How to Solve]
- “NameError: name ‘re’ is not defined” [How to Solve]
- [Solved] Tensorflow Error: NameError: name ‘layers‘ is not defined
- NameError: name ‘null’ is not defined [How to Solve]
- [Solved] Selenium python send_key error: list object has no attribute
- NameError: name ‘_C‘ is not defined [How to Solve]
- NameError: global name ‘***‘ is not defined [How to Solve]
- [Solved] selenium.common.exceptions.JavascriptException: Message: javascript error: windows is not defined
- [Python] Right-click Selenium to Save the picture error: attributeerror: solution to module ‘pyscreen’ has no attribute ‘locationonwindow’
- Crawler overtime error socket.timeout: timed out/NameError: name ‘socket‘ is not defined
- Python Selenium: element is not attached to the page document error
- Python Selenium Common Keyboard Controls