我使用 Web 驱动程序连接到 selenoid 容器
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType
proxy = 'proxy address'
link = '2ip.ru'
capabilities = {
"browserName": 'firefox',
"version": '71.0',
"platform": 'LINUX'
}
prox = Proxy()
prox.proxy_type = ProxyType.MANUAL
prox.http_proxy = proxy
prox.ssl_proxy = proxy
prox.socks_proxy = proxy
prox.add_to_capabilities(capabilities)
driver = webdriver.Remote(
command_executor='http://localhost:4444/wd/hub',
desired_capabilities=capabilities
)
driver.get(link)
使用任何代理获取页面在 2ip.ru 或任何类似网站中具有相同的 IP。为什么 selenoid 不应用代理 IP?尝试图像 selenoid/firefox:60.0, selenoid/firefox:61.0, selenoid/firefox:62.0, selenoid/firefox:70.0, selenoid/firefox:71.0, selenoid/firefox:72.0。