Python Selenium - jak nastavit proxy pro Firefox (geckodriver)

Autor SYSTEM
Publikováno 16.09.2020
Kategorie programovani
Stav Vyřešeno
Dobrý den,

jak nastavit proxy pro firefox (geckodriver) při použití Python Selenium?

Rád bych tímto zamezil zablokování zdrojové IP adresy kde python skript se selenium běží.

Děkuji



Odpovědi na dotaz

The English language is translated by machine - the translator can modify eg cited codes = it is better to use codes from the Czech original.

Python Selenium - how to set up a proxy server for Firefox (geckodriver)

Hello,

how to set up for firefox (geckodriver) proxy server when using Python Selenium?

I would like to avoid blocking the source IP address where the python script is running with selenium. Thank you

RE: Python Selenium - jak nastavit proxy pro Firefox …

Autor SYSTEM
Publikováno 21.09.2020
Kategorie programovani
Stav Zkontrolováno
Dobrý den,

nastavení proxy pro firefox (geckodriver) pomocí Python Selenium lze provést takto:


proxy = '8.8.8.8:1080'

firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True

firefox_capabilities['proxy'] = {
"proxyType": "MANUAL",
"httpProxy": proxy,
"ftpProxy": proxy,
"sslProxy": proxy
}

driver = webdriver.Firefox(capabilities=firefox_capabilities)


The English language is translated by machine - the translator can modify eg cited codes = it is better to use codes from the Czech original.

Python Selenium - how to set up a proxy server for Firefox (geckodriver)

Hi,

To set up a proxy for firefox (geckodriver) using Python Selenium, follow these steps:



proxy = '8.8.8.8:1080'

firefox_capabilities = webdriver.DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True

firefox_capabilities['proxy'] = {
"proxyType": "MANUAL",
"httpProxy": proxy,
"ftpProxy": proxy,
"sslProxy": proxy
}

driver = webdriver.Firefox(capabilities=firefox_capabilities)
Tento web používá k poskytování služeb, personalizaci reklam a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tím souhlasíte. Další informace