当我运行它时,我在firefox中获得了SEC_ERROR_UNKNOWN_ISSUER。我该怎么办?我是一个代码新手,所以你的建议非常感谢。 我用 OS Mac High Sierra 10.13.3 Selenium版本3.11.0 浏览器Firefox 59.0.1
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
import csv
import os
import random
import time
class BingEnter(object):
def __init__(self, email, password):
self.email = email
self.password = password
self.explicit_wait = 3
self.driver = webdriver.Firefox()
self.login_url = "https://login.live.com/"
def login(self):
self.driver.get(self.login_url)
email_input = self.driver.find_element_by_name("loginfmt")
email_input.send_keys(self.email)
self.driver.find_element_by_id("idSIButton9").click()
wait = WebDriverWait(self.driver, self.explicit_wait)
wait.until(EC.presence_of_all_elements_located((By.ID,
"idSIButton9")))
password_input = self.driver.find_element_by_name("passwd")
password_input.send_keys(self.password)
wait = WebDriverWait(self.driver, self.explicit_wait)
wait.until(EC.presence_of_all_elements_located((By.ID,
"idTd_PWD_KMSI_Cb")))
self.driver.find_element_by_id("idSIButton9").click()
with open('bing_account.csv', 'r') as f:
reader = csv.reader(f)
for row in reader:
user_id = row[0]
password = row[1]
bing_enter = BingEnter(user_id, password)
bing_enter.login()