我正在尝试从一个包含阿根廷代表投票的公共网站自动下载excel文件。例如,从以下页面:https://votaciones.hcdn.gob.ar/votacion/4108
我正在通过Python使用firefox webdriver和Selenium。 当我尝试单击图像中的按钮时:
我收到以下信息:
selenium.common.exceptions.ElementClickInterceptedException: Message: Element is not clickable at point (229,480) because another element obscures it
如果我试图通过driver.execute_script('javascript:exportExcel();')
在页面内执行特定于下载excel的脚本
什么也没发生
有什么办法可以让它工作吗
下面是一个使用Autoit的示例。链接:https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/
您需要单击下载按钮,然后使用Autoit或其他ui自动机创建下载对话框的自动化
最后,我终于可以完成了。我使用了this page中提出的例程。但是必须通过
options.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
更改options.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream,application/vnd.ms-excel")
指令例如:
相关问题 更多 >
编程相关推荐