Comments (1)
`
from fake_useragent import UserAgent
ua = UserAgent()
def request_douban(url):
try:
headers = {'User-Agent': ua.chrome}
response = requests.get(url,headers=headers)
`
加一个headers=headers请求头就行了,
加上加粗的部分,其他代码不变
from learn_python3_spider.
Related Issues (20)
- 当当top500 HOT 2
- 爬虫
- 怎么无法访问了
- 好
- (please help) having problem in my code
- error HOT 3
- 博主老司机无疑了
- 基础
- 爬取 20w 表情包 HOT 1
- **获取到搜索的input框后需要先.click()然后再.send_keys()** HOT 2
- 大佬POST数据拿不到这个怎么搞要 HOT 1
- 爬虫学习
- 1 HOT 2
- 真诚求问 大佬有没有 兴趣接个广子啊?
- GitHub合作 HOT 5
- 爬虫11中爬取蔡徐坤教程soup中返回的一堆数字是不是bilibili的反爬手段?还是说是我操作问题
- 教程这里有一些小错误,让新手很困惑 HOT 2
- 使用Google浏览器运行自动化测试程序时该浏览器内存占用会不断提升,超过6G后网页就会奔溃,这个问题有什么解决方法吗? HOT 1
- 网页禁F12 HOT 1
- 请求商务推广合作 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learn_python3_spider.