当前位置:网站首页>Resolved (the latest version of selenium reported an error) attributeerror: module 'selenium webdriver‘ has no attribute ‘PhantomJS‘
Resolved (the latest version of selenium reported an error) attributeerror: module 'selenium webdriver‘ has no attribute ‘PhantomJS‘
2022-07-25 02:45:00 【No envy】
resolved ( The latest version selenium Report errors )AttributeError: module ‘selenium.webdriver’ has no attribute ‘PhantomJS’
List of articles
Error message
My code :
from selenium import webdriver
browser = webdriver.PhantomJS()
# Send a request
browser.get('https://www.baidu.com/')
# Print the title of the page
print(browser.title)
# Exit the simulation browser
browser.quit() # Make sure you quit ! If you don't quit, there will be residual processes
Error message :
Traceback (most recent call last):
File "E:/Python Study /1.py", line 3, in <module>
browser = webdriver.PhantomJS()
AttributeError: module 'selenium.webdriver' has no attribute 'PhantomJS'

Error report translation
Error report translation :AttributeError: modular “selenium”.“webdriver” There is no attribute “PhantomJS”
Error reason
Error reason : New version of the selenium Has given up PhantomJS, That's why module ‘selenium.webdriver’ has no attribute ‘PhantomJS’.PhantomJS The installation is the latest version ,pip install selenium The latest version is also installed .
resolvent
1. The first selenium uninstall , The code is as follows :
pip uninstall selenium
2. install selenium==2.48.0 Version of , The code is as follows :
pip install selenium==2.48.0
Screenshot of specific operation :

3. Run again successfully :

边栏推荐
- Visualization of correlation coefficient matrix
- Genesis, the world's first "consumption investment" public chain, was invited to participate in consensus 2022
- YouTube Download and (batch) Download
- Remote sensing image classification tool and visualization application of WebGIS
- Execution methods with static code blocks and child and parent classes
- Case analysis of building exhibition service management system with low code development platform
- Summary thinking caused by the function of a SMS verification code [easy to understand]
- Flink's study notes
- Redux best practices "Redux toolkit"
- Strategy mode, just read one article
猜你喜欢

Flink's study notes

Details of C language compilation preprocessing and comparison of macros and functions

Custom types in C language

Mgre.hdlc.ppp.chap.nat comprehensive experiment

How to take the mold for the picture of 1.54 inch TFT st7789 LCD screen

Wechat sports field reservation of applet completion works applet graduation design (8) graduation design thesis template

TS uses a third-party library, and there is no type declaration file error handling

DLL load failed: the page file is too small to complete the operation

Pagoda workman WSS reverse proxy socket legal domain name applet chat remove port

Consul cluster deployment
随机推荐
Insertion of balanced binary tree (AVL tree)
Explanation of C language file operation function
Use unicloud cloud function to decode wechat motion steps in applet
A bit of knowledge - websites about scripts
Physical experiment simulation
Jedispoolconfig parameter configuration from the perspective of source code
Request and response
Flutter apple native Pinyin keyboard input exception on textfield | Pinyin input process callback problem
Redis unauthorized access vulnerability recurrence (www.hetianlab.com)
Digital commerce cloud fine chemical industry management platform integrated informatization solution
Componentization and modularization
Daily three questions 7.16
After upgrading v2.1.0, the synchronization failed
Please ask a question: how to set the new table of MySQL CDC 2.2.x to only receive increment
After six years of precipitation, new consumption has found a digital transformation paradigm
Matlab draws radar chart (four lines of code)
On Calc optimization of calcite
Failed to create data snapshot: lock file [/siyuan/data/assets/image- 2022070216332-jijwccs.png failed: open /siyuan/data/assets/image- 2022070216332-jijwccs.png: permission denied; unable to lock fil
BGP introduction
C: wechat chat software instance (wpf+websocket+webapi+entityframework)