[英]selenium chrome webdriver with toripchanger
我正在尝试使用 selenium 打开谷歌搜索结果。 我使用 toripchanger 迭代地更改 ip。
tor_ip_changer = TorIpChanger(reuse_threshold=0,
local_http_proxy='127.0.0.1:8118')
ip = tor_ip_changer.get_new_ip()
current_ip = tor_ip_changer.get_current_ip()
PROXY = "%s:8118" % ip
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=https://%s' % PROXY)
browser = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver",
options=chrome_options)
browser_1 = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver",
options=chrome_options)
search_query = "microsoft site:instagram.com"
browser.get("https://www.google.com/search?q=" + search_query + "&start=" + str(10 * i))
但驱动无法打开 url。 我没有得到谷歌的回应。
检查代理工作后,试试这个。 删除“https://”
chrome_options.add_argument('--proxy-server=%s' % PROXY)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.