【发布时间】:2015-09-26 13:12:31
【问题描述】:
我正在尝试单击一个按钮,该按钮会弹出一个对话框来选择文件。检查它看起来像是输入而不是按钮的元素。无论哪种方式,我都无法点击它:
element = browser.find_element_by_id("fileupload")
element.click()
和
browser.find_element_by_id("fileupload").send_keys("\n")
这两种方法似乎都不起作用。
这是我在页面上检查该元素时看到的内容:
<span class="btn btn-success fileinput-button">
<span class="glyphicon glyphicon-upload"></span>
Select and Upload...
<input id="fileupload" name="upfile" accept=".xml" type="file">
</span>
任何帮助或指点将不胜感激!
【问题讨论】:
标签: python html selenium input selenium-webdriver