Why does the program stop at the line driver = webdriver.Firefox(…)? No errors, just hangs on it

from selenium import webdriver
import time
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.proxy import ProxyType, Proxy

with open('proxy', 'r') as f:
    array = f.read().splitlines()

for _ in range(10):
    prox = Proxy()
    prox.proxy_type = ProxyType.MANUAL
    prox.http_proxy = array[_]
    prox.socks_proxy = array[_]
    prox.ssl_proxy = array[_]
    capabilities = webdriver.DesiredCapabilities.FIREFOX
    prox.add_to_capabilities(capabilities)
    driver = webdriver.Firefox(desired_capabilities=capabilities, executable_path='/home/alexandr/geckodriver')
    driver.set_page_load_timeout(10)
    try:
        driver.get("https://2ip.ru/")
    except TimeoutException:
        driver.quit()
    time.sleep(7)

The browser opens with an empty address bar and nothing happens.

Author: nomnoms12, 2019-08-30

1 answers

Check your driver again. Most likely you have an outdated version, currently up to date 26.

Wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux32.tar.gz

 0
Author: Lip4ik, 2019-11-05 21:07:26