爬虫 UserAgent 伪装 fake_useragent

import random
from fake_useragent import UserAgent
import random
ua=UserAgent()
p = ua.randomA
print(p)

输出:

Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36
[Finished in 0.5s]

你可能感兴趣的:(爬虫 UserAgent 伪装 fake_useragent)