Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from fp.fp import FreeProxy
- from selenium.webdriver.common.proxy import Proxy, ProxyType
- from selenium import webdriver
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.common.keys import Keys
- from selenium.webdriver.support import expected_conditions as ec
- from selenium.webdriver.common.by import By
- from selenium.webdriver.firefox.options import Options
- from selenium.webdriver.firefox.service import Service as FirefoxService
- from webdriver_manager.firefox import GeckoDriverManager
- options = Options()
- # options.add_argument("-headless")
- proxy = FreeProxy(rand=True).get()[7:]
- print(proxy)
- options.proxy = Proxy({
- "proxyType": ProxyType.MANUAL,
- "httpProxy": proxy
- })
- driver = webdriver.Firefox(service=FirefoxService(GeckoDriverManager().install()), options=options)
- driver.get("https://www.letu.ru/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement