Randomly generated useragent

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/lipachong/article/details/101674339

from fake_useragent import UserAgent
ua = UserAgent()
useragent=ua.chrome#随机生成谷歌浏览器的useragent,想要各种浏览器的改chrome为randome
headers={
        'User-Agent':useragent
}

Guess you like

Origin blog.csdn.net/lipachong/article/details/101674339