faker库如何生成user-agent

正文

生成随机的user-agent,可以这么写

from faker import Faker
ua=Faker().user_agent()

也可以这么写

from faker import Faker
from faker.providers.user_agent import Provider
ua=Provider(Faker()).user_agent()

总结

有些东西写不出来,写出来也。。。。。。。。

猜你喜欢

转载自blog.csdn.net/qq_63401240/article/details/129008086