Lixinhang

1. 先安装库

  pip install pypiwin32

2. 使用时导入库

  import win32com.client

  shell = win32com.client.Dispatch("WScript.Shell")

from selenium import webdriver
import win32com.client

driver = webdriver.Chrome(r"D:\webdriver\chromedriver_73.0.3683.68.exe")
driver.implicitly_wait(20)
driver.get("https://tinypng.com/")
shell = win32com.client.Dispatch("WScript.Shell")

driver.find_element_by_xpath("//*[@class=\'icon\']").click()
shell.Sendkeys(r"D:\taihu.png"+"\n")

input(\'...\')
driver.quit()

分类:

技术点:

相关文章:

  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-01-08
  • 2021-11-04
  • 2021-11-18
猜你喜欢
  • 2022-12-23
  • 2021-09-09
  • 2022-01-07
  • 2021-10-07
  • 2021-08-03
  • 2022-12-23
  • 2021-10-07
相关资源
相似解决方案