FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonStudy/spider2/Selenium_Phantomjs.py at master · gitstudy8/pythonStudy · GitHub
gitstudy8
pythonStudy
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonStudy
/
spider2
/
Selenium_Phantomjs.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
11 lines (8 loc) · 508 Bytes
Breadcrumbs
pythonStudy
/
spider2
/
Selenium_Phantomjs.py
Copy path
File metadata and controls
11 lines (8 loc) · 508 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
# coding=utf-8
## ## 数据抓取的艺术(一):Selenium+Phantomjs数据抓取环境配置
## http://blog.chinaunix.net/uid-22414998-id-3692113.html
from
selenium
import
webdriver
driver
=
webdriver
.
PhantomJS
()
driver
.
get
(
'https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=find_element_by_id&rsv_pq=9d649aca00042b2c&rsv_t=a181vl3FtiZy7pD8F1jVjokLF7lNNLSOylE%2BtG2QmGjBolkyrWYXYMNkjZk&rqlang=cn&rsv_enter=1&rsv_sug3=2&rsv_n=2'
)
data
=
driver
.
find_element_by_id
(
'su'
).
text
print
data
Back
|
FazBrowse Home
|
New Git URL