Python java.lang.NoSuchMethodException:操作[/Criticita]不包含指定的方法(检查日志)

Python java.lang.NoSuchMethodException:操作[/Criticita]不包含指定的方法(检查日志),python,web-scraping,automation,download,python-requests,Python,Web Scraping,Automation,Download,Python Requests,我想在公司网站的特定页面下载Excel报告。要手动执行此操作,我必须单击“下载xlsx”按钮。当我单击此按钮时,另一个选项卡浏览器打开(带有url…),页面开始加载,1分钟后,xlsx文件出现在下载栏中,下载开始 我写了这个简单的脚本: import requests from requests_ntlm import HttpNtlmAuth res = requests.get('http://maremt.risorse.enel/dynamic/maremt/Criticita.do?

我想在公司网站的特定页面下载Excel报告。要手动执行此操作,我必须单击“下载xlsx”按钮。当我单击此按钮时,另一个选项卡浏览器打开(带有url…),页面开始加载,1分钟后,xlsx文件出现在下载栏中,下载开始

我写了这个简单的脚本:

import requests
from requests_ntlm import HttpNtlmAuth

res = requests.get('http://maremt.risorse.enel/dynamic/maremt/Criticita.do?operation=generaXlsElencoCriticita&elencoTipoCriticita=&elencoValutazione=1,2&elencoFonteCriticita=&elencoStati=&dataStart=&dataEnd=&tipoData=0&tipoEle=ZO&ikEle=2621000&start=0&limit100&selezione=criticitaRicerca&idCriticita=null&idAdl=&statoOdm=false&fileName=Report_Elenco_Criticita.xlsx', auth=HttpNtlmAuth('user','pass'))
criticita = open('criticità.xlsx', 'wb')

for chunk in res.iter_content(100000):
    criticita.write(chunk)
请求中的url与我单击按钮时在“新建浏览器”选项卡上显示的url相同

这是我在尝试打开服务器的url响应时遇到的错误:

我得到了一个xlsx文件,但当我试图打开它时,会出现以下错误:

"Excel cannot open the file 'filename. xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."
不管怎样,如果我试图在谷歌上复制并通过这个url,我无论如何都得不到这个文件。。。所以我相信这不是我需要的网址

我还尝试使用网络面板和corresponding cURL命令的转换来获取特定请求,但是当我单击按钮时,网络面板中没有出现任何请求(get或POST)


我绝望了。。。请帮助我。

使用selenium方法单击Behavior,我已经尝试过了,但我在确定正确的选择器时遇到了问题。看看这个>>