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地域とセッションはユーザー名の中にあり、ホストやポートにはありません。国を変えてもこのページの設定はそのままで、書き換えるのは1つの文字列だけです。199か国を指定でき、その多くでは都市・州のトークンも使えます。