随机切换user-agent

import fake_useragent
import random

ua = fake_useragent.UserAgent()

print(getattr(ua,random.choice(list(fake_useragent.settings.SHORTCUTS.keys()))))
posted @ 2018-12-25 16:29  篓子  阅读(367)  评论(0编辑  收藏  举报