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