Форум сайта python.su
Сам код:
from selenium import webdriver from selenium.webdriver.firefox.options import Options userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' proxy = '89.238.190.164' port = 3128 options = Options() options.add_argument("-profile") options.add_argument(r"E:\\browser\\mozila\\007\\Data\\profile") proxy_profile = webdriver.FirefoxProfile() proxy_profile.set_preference("general.useragent.override", userAgent) proxy_profile.set_preference("network.proxy.type", 1) proxy_profile.set_preference("network.proxy.http", proxy) proxy_profile.set_preference("network.proxy.http_port", port) proxy_profile.set_preference("network.proxy.ssl", proxy) proxy_profile.set_preference("network.proxy.ssl_port", port) proxy_profile.set_preference("network.proxy.https", proxy) proxy_profile.set_preference("network.proxy.https_port", port) driver = webdriver.Firefox(options=options, firefox_profile=proxy_profile) driver.get('https://google.com')
from selenium import webdriver driver = webdriver.Firefox() driver.get('https://google.com')
Отредактировано ZiG (Авг. 15, 2019 11:08:01)
Офлайн