大家好 我想通过selenium自动上传PDF文件 用Python编写 因为谷歌硬盘不允许仅仅通过发送U键来完成 我希望获得有关如何自动执行此操作的帮助
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium import webdriver as wd
driver=webdriver.Chrome(executable_path="C:\\Users\\l1313\\Desktop\\app\\chromedriver.exe")
p="C:\\Users\\l1313\\Desktop\\upload\\10.pdf"
driver.get("https://script.google.com/macros/s/AKfycbxw2AvTpz4ksUIVPME3bWca5hp89sE3CjraDGJEu2c/dev")
time.sleep(5)
driver.find_element_by_xpath("/html/body/form/input[1]").send_keys(p)
我用的是一个 “应用程序脚本” 创建一个上传文件,但我需要文件自动上传
如果通过Selenium有可能,我想听听
谢谢
通过此代码 从HTML
这是code.gs的代码
相关问题 更多 >
编程相关推荐