AttributeError:“ NoneType”对象没有属性“ accept_untrusted_certs”

时间:2019-10-09 07:40:53

标签: python-3.x selenium

我编写了用于登录网页的代码。

from selenium import webdriver
browser = webdriver.Firefox()
browser.get(URL)

username = browser.find_element_by_id("username")
password = browser.find_element_by_id("password")
username.send_keys("hello")
password.send_keys("hello")
login_attempt = browser.find_element_by_xpath("//*[@type='submit']")
login_attempt.submit()

browser.firefox_profile.accept_untrusted_certs = True

但我收到此错误

AttributeError: 'NoneType' object has no attribute 
'accept_untrusted_certs'

如何解决?

0 个答案:

没有答案