【爬虫】伪装用户代理——fake-uaseragent
fake-useragent:伪装浏览器身份,多用于反爬虫。
一、安装
打开终端,用pip安装fake-useragent模块。
pip install fake-useragent
二、用法
from fake_useragent import UserAgent
ua = UserAgent()
ua.ie
# Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US);
ua.msie
# Mozilla/5.0 (compatible; MS
原创
2020-07-13 17:23:02 ·
779 阅读 ·
0 评论