【发布时间】:2020-11-29 01:02:49
【问题描述】:
信息
我想使用 python selenium 自动化网络服务器 http://bioinfo.unipune.ac.in/IRESPred/IRESPred.html。
html代码
<input name="fileToUpload" type="file" class="btn btn-default btn-file btn-sm" xpath="1">
代码
from selenium import webdriver
import time
driver = webdriver.Edge(r"C:\Users\Amardeep\Downloads\msedgedriver.exe")
driver.maximize_window()
driver.get("http://bioinfo.unipune.ac.in/IRESPred/IRESPred.html")
time.sleep(2)
button = driver.find_element_by_xpath("//input[@name = 'fileToUpload']").click()
输出错误
selenium.common.exceptions.InvalidArgumentException:消息:无效参数
尝试过的解决方案
我使用不同的 x 路径单击打开一个窗口以上传文件路径的按钮,但按钮不可单击。我使用按名称、类名、css 选择器查找元素,但它也不起作用。我该如何解决这个问题。
【问题讨论】:
-
感谢@dimay 纠正我的问题。
标签: selenium browser-automation