
fake_useragent第三方库,来实现随机请求头的设置;
GitHub ---> https://github.com/hellysmile/fake-useragent
安装 ---> pip/pip3 install fake-useragent(安装方式看你pip的版本)
查看useragent ---> http://fake-useragent.herokuapp.com/browsers/0.1.5
简单的使用:
from fake_useragent import UserAgent ua = UserAgent() print(ua.ie) #随机打印ie浏览器任意版本 print(ua.firefox) #随机打印firefox浏览器任意版本 print(ua.chrome) #随机打印chrome浏览器任意版本 print(ua.random) #随机打印任意厂家的浏览器 UserAgent(verify_ssl=False).random
评价
排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术