Selenium 代理配置
Browser automation across Chrome, Firefox and Edge. 按下面的配置把它指向 Eveses 住宅池 — 地区写在用户名里,所以换国家不需要动其他任何设置。
proxy.eveses.com:12321 · SOCKS5 在 32325 · 199 个国家 · $7.35/GB 起
Chrome's `--proxy-server` flag cannot carry a username and password — Chrome shows a native auth dialog that Selenium cannot type into. Either whitelist your IP in the dashboard and use the flag unauthenticated, or ship a tiny extension that answers the auth challenge.
配置
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opts = Options()
# Works only with IP whitelisting — Chrome ignores user:pass in this flag.
opts.add_argument("--proxy-server=http://proxy.eveses.com:12321")
driver = webdriver.Chrome(options=opts)
# With credentials, use Firefox instead — it accepts them via a profile:
from selenium.webdriver.firefox.options import Options as FxOptions
fx = FxOptions()
fx.set_preference("network.proxy.type", 1)
fx.set_preference("network.proxy.http", "proxy.eveses.com")
fx.set_preference("network.proxy.http_port", 12321)
fx.set_preference("network.proxy.ssl", "proxy.eveses.com")
fx.set_preference("network.proxy.ssl_port", 12321)Selenium 相关说明
Whitelist the machine's IP in the cabinet if you use the Chrome flag.
Selenium Wire is the usual workaround for authenticated Chrome, at the cost of an in-process mitm proxy.
换国家而不动 Selenium
eveses_user_country-deeveses_user_country-de_session-ab12cd34_lifetime-30m地区和会话都写在用户名里,而不是主机或端口。换国家时本页所有配置保持原样 — 你只改一个字符串。可定位 199 个国家,其中大多数还支持城市与州/省令牌。