当前位置:网站首页>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 :

边栏推荐
- How to communicate with aliens
- DNA helped solve the outstanding case 30 years ago. The suspect strangled his girlfriend because he fell in love with his roommate. He was already the CEO of the technology company when he was arreste
- Redux best practices "Redux toolkit"
- 6. Object storage
- Jenkins plug-in development -- plug-in expansion
- Domain driven model (DDD)
- Rotating frame target detection mmrotate v0.3.1 training hrsc2016 data set (II)
- Work arrangement of generator set
- Use unicloud cloud function to decode wechat motion steps in applet
- Cookies and sessions
猜你喜欢

Unable to display spline in UE4 (unreal engine4) terrain editing tool

Tp5.1 include include files (reference public files)

"Ask the sky" is in place! Yu Jingchuan's "China Space Station" in 2013 is about to set sail in the sea of stars

Flink's study notes

English grammar_ Reflexive pronoun

Apk packaging process

R language uses logistic regression, ANOVA, outlier analysis and visual classification iris iris data set

Wechat sports field reservation of the finished works of the applet graduation project (5) assignment

Explorer TSSD 2019 software installation package download and installation tutorial

Picgo configuring Alibaba cloud OSS
随机推荐
It7259q-13, it7259ex-24 feature wearable devices
How MySQL 8.0 based on TRX_ Id find the statement of the whole transaction
Industrial control safety PLC firmware reverse II
Domestic edge computing organization and product research
What are the basic skills of engineers? How to practice? -- Learning experience sharing "suggestions collection"
Can PostgreSQL CDC only connect to the main database? Connection from the library reports an error logical decoden
BGP introduction
B2B e-commerce trading platform of heavy metal industry: breaking the state of data isolation and improving the benefits of heavy metal industry
Summary and sorting of XSS (cross site script attack) related content
[circular array] JS method collection of circular array
Analysis of FLV packaging
Conceptual distinction between Po, Bo, VO, dto and POJO
Using the artifact typora+picgo, Youdao cloud can automatically upload pictures in markdown without members
Wechat sports field reservation of the finished works of the applet graduation project (5) assignment
SQL recursive follow-up
Redux best practices "Redux toolkit"
Inheritance (prototype)
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
Automatic backup of Linux server PostgreSQL database
How to communicate with aliens