upload_image.py
308 Bytes
from selenium import webdriver
from time import sleep
driver=webdriver.Firefox()
driver.get("https://www.baidu.com")
driver.find_element_by_css_selector(".soutu-btn").click()
sleep(3)
driver.find_element_by_css_selector(".upload-pic").send_keys(r"E:\Python+Selenium\sc4\cat.jpg")
sleep(3)
# driver.quit()