Day2: Notes

.Request request a library crawling IMDb message
- url request
https://movie.douban.com/top250
- request method
GET
- request header
the User-Agent
Cookies

two .selenium request library
1. What is selenium?
Opening is an automated testing tool
principle is to drive a certain good browser to perform some operation
on the reptile is essentially analog browser, so you can use it for reptiles

2. Why should I use selenium?
Advantages:
- js code execution
- no need to analyze complex communication process
- can do pop, pull down other operations on the browser
- ***** obtain dynamic data
- *** crack the login authentication
Disadvantages:
- low efficiency
3. installation and use
① install selenium request library:
PIP3 install selenium

② must install the Google browser:
"Google" or Firefox

③ drive installed browser:
http://npm.taobao.org/mirrors/chromedriver/2.38/
Windows:
Download win32 drive

Guess you like

Origin www.cnblogs.com/Auraro997/p/11119981.html