profile=webdriver.FirefoxOptions()
profile.add_argument('-headless') #设置无头模式
#设置代理服务器
profile.set_preference('network.proxy.type', 1)
profile.set_preference('network.proxy.http',IP)#IP为你的代理服务器地址:如‘127.0.0.0’,字符串类型
profile.set_preference('network.proxy.http_port', PORT) #PORT为代理服务器端口号:如,9999,整数类型
browser=webdriver.Firefox(options=profile)
selenium 设置火狐无头模式和代理服务器
最新推荐文章于 2024-07-28 00:12:28 发布