12.文件上传send_keys

# coding:utf-8
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("https://i.cnblogs.com/posts/edit")
# 点开编辑图片
driver.find_element_by_id("Editor_Edit_EditorBody_uploadImage").click()
time.sleep(3)
# 定位iframe
iframe = driver.find_element_by_id("mce_58_ifr")
driver.switch_to.frame(iframe)
# 上传图片
driver.find_element_by_name("file").send_keys(r"file:///E:/F3597EC30ED1C56107BF45A993205F6A.jpg")

12.文件上传send_keys

上一篇:HTML


下一篇:Java --Annotation学习心得体会及笔记