title: user-agent反反爬
author: 杨晓东
permalink: user-agent反反爬
date: 2021-10-02 11:27:04
categories:
- 投篮
tags:
- demo
user-agent反反爬
import fake_useragent
# 实例化 user-agent 对象
ua = fake_useragent.UserAgent()
for i in range(100):
print(ua.random) # Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36
# print(ua.random) # Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)
# print(ua.random) # Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36
标签:反反,random,agent,537.36,user,ua
From: https://www.cnblogs.com/demo443/p/17155215.html