from selenium import webdriver
from time import sleep
driver=webdriver.Firefox()
url=r"C:\Users\Desktop\learn_book\02img\注册A.html"
driver.get(url)
username=driver.find_element_by_id("userA")
#
username.send_keys("admin")
#
password=driver.find_element_by_id("passwordA")
sleep(3)
driver.quit()
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
driver=webdriver.Firefox()缺少参数:
executable_path=(安装目录)
firefox_options=firefox_options
url不能直接写路径,需要在前面加file:///
url=r"file:///C:\Users\Desktop\learn_book\02img\注册A.html"
driver.get(url)