简体   繁体   English

自动填写Web表单以导出报告报告

[英]Automate web form filling to export report reports

I have a daily task of downloading a Report[an Excel file] . 我的日常任务是下载报告[Excel文件]。 Before I click the download button, certain fields have to filled and some checkboxes need to be checked. 在单击下载按钮之前,必须填写某些字段,并且需要选中一些复选框。 On clicking the executable file on my desktop, the whole process must happen in one go. 在我的桌面上单击可执行文件后,整个过程必须一次性完成。 I m looking for an opensource solution either in Javascript or JQuery to automate this download. 我正在寻找Javascript或JQuery的开源解决方案来自动化此下载。

After the information you shared, I'm afraid you'll have to write an application in a desktop programming language. 共享信息之后,恐怕您将不得不使用桌面编程语言来编写应用程序。 It doesn't really matter which language you use, and I'm not going to make suggestions since I don't know your situation. 使用哪种语言并不重要,由于我不了解您的情况,因此我不会提出建议。

The fun part will be determining what the browser does. 有趣的部分将是确定浏览器的功能。 The browser will basically send a HTTP request, either a POST or a GET (I don't know which one it is since I don't know the page). 浏览器基本上会发送一个HTTP请求,即POST或GET(我不知道它是哪个,因为我不知道该页面)。 You'll have to open your developer tools in your browser, check what it sends and how it sends it and where it sends it, then recreate that using your language of choice. 您必须在浏览器中打开开发人员工具,检查其发送内容,发送方式以及发送位置,然后使用您选择的语言重新创建该工具。 You then need to read the response and turn it into an excel file. 然后,您需要阅读响应并将其转换为excel文件。

Now, this is quite challenging and I don't know how experienced you are. 现在,这非常具有挑战性,我不知道您的经验如何。 If you are willing to give up the desktop executable requirement, you can write a Greasemonkey script (in Firefox) or a Chrome extension (for Chrome, duh) which can automate this from the browser. 如果您愿意放弃桌面可执行文件的要求,则可以编写一个Greasemonkey脚本(在Firefox中)或一个Chrome扩展程序(对于Chrome,duh),可以从浏览器中自动执行该脚本。 Both use Javascript and are arguably easier to create since you don't need to recreate the HTTP request or reverse engineer what the browser does. 两者都使用Javascript,并且可以说更易于创建,因为您不需要重新创建HTTP请求或对浏览器进行反向工程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM