随机生成useragent
程序员文章站
2022-05-09 10:04:37
...
from fake_useragent import UserAgent
ua = UserAgent()
useragent=ua.chrome#随机生成谷歌浏览器的useragent,想要各种浏览器的改chrome为randome
headers={
'User-Agent':useragent
}