python - 如何在 python selenium firefox webdriver 中设置标题
问题描述
我正在通过一个名为 ProxyMesh 的站点进行 IP 旁路编程。
下面是我创建的代码。
def ip_bypass_proxymesh():
profile = webdriver.FirefoxProfile()
profile.set_preference("browser.privatebrowsing.autostart", True)
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.http", '1xx.2xx.1xx.30')
profile.set_preference("network.proxy.http_port", 312xx)
profile.set_preference("network.proxy.ssl", '45.32.2xx.x6')
profile.set_preference("network.proxy.ssl_port", 31xxx)
driver = webdriver.Firefox(firefox_profile=profile, executable_path='D:\webdrivers/geckodriver')
return driver
我想添加一个指定国家的标题,
------>>> header = {'X-ProxyMesh-Country: US'}
但我不知道。(我搜索了这个,但由于我是初学者,我不明白。)
如果你让我知道,我将不胜感激。
https://docs.proxymesh.com/article/7-request-response-headers#x-proxymesh-country
非常感谢。
解决方案
推荐阅读
- ios - 权限被拒绝后可以访问照片库和相机
- java - 应用程序崩溃后服务无法继续运行
- c++ - 有没有办法从地图中获取特定的键值对?
- arrays - Kotlin 中具有“n”元素的数组不起作用
- python - 格式化由字典制作的 csv 行
- c++ - 当我使用快速排序对双向链表进行排序时,用户消失了
- c++ - 我什么时候需要使用/拥有一个makefile?
- android - Android,对于 JNI,是否应该在 InputMethodService 中调用 System.loadLibrary?
- php - bash 将输出重定向到文件 - 无法存储临时文本
- spring - Spring Boot 应用程序在 AutoConfigurationImportFilter 上失败,无法构建但未指定类