带有toripchanger的硒铬webdriver

问题描述 投票:0回答:1

我正在尝试打开Goog​​le搜索结果中的硒。我使用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。我没有收到Google的回复。

python python-3.x python-2.7 selenium-webdriver selenium-chromedriver
1个回答
0
投票

检查代理服务器后,请尝试此。删除“ https://”

chrome_options.add_argument('--proxy-server=%s' % PROXY)
© www.soinside.com 2019 - 2024. All rights reserved.