当我使用代理时,我的几个网页(等等facebook)加载速度非常慢。这是脚本:
import random import time import os import sys from selenium import webdriver chromedriver = "chromedriver.exe" os.environ["webdriver.chrome.driver"] = chromedriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException import unittest from time import gmtime, strftime from datetime import datetime from random import randint PROXY = "114.77.67.32:22" # IP:PORT or HOST:PORT chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--proxy-server=http://%s' % PROXY) driver = webdriver.Chrome(chrome_options=chrome_options) driver.get("http://web.facebook.com")
使用其他IP访问网页是否很好?
答案 0 :(得分:0)
启动Webdriver时是否使用-trustAllSSLCertificates
参数?它帮助了resolved problem。
否则你应该尝试其他代理或连接以从其他主机启动测试,除此之外别无其他。