Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以,我在网站上有一个按钮,可以打开文件资源管理器的实例,我想自动选择具有给定目录的文件。我怎么能通过python做到这一点?
您无法使用 selenium 访问文件资源管理器,您必须使用 autoit 等工具,
一种解决方法是将文件路径发送到输入元素并单击提交按钮
driver.find_element_by_xpath("//input[@type='file']").send_keys(r"full/filepath")