简体   繁体   English

带有Chrome WebDriver的Python Selenium-更改用户代理

[英]Python selenium with chrome webdriver - change user agent

I am running some code with selenium using python, and I figured out that I need to dynamically change the UserAgent after I already created the webdriver. 我正在使用python使用selenium运行一些代码,我发现已经创建了webdriver后需要动态更改UserAgent。 Any advice if it is possible and how this could be done? 有什么建议,如果有可能,以及如何做到? Just to highlight - I want to change it on the fly, after almost each GET or POST request I send 只是要突出显示-我想在我发送几乎每个GET或POST请求后即时更改它

我将创建一个新的驱动程序,并从旧驱动程序中复制所有必需的属性,但用户代理除外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM