2010-05-22 43 views
0

我在尝试制作一个脚本,它将使用POST从HTTPS网站下载搜索结果。到目前为止,我可以在提交之前下载网页,而不是包含搜索结果的响应页面。问题似乎是curl没有足够长的时间来响应页面出现。
使用curl接收帖子回复

网站的行为是这样的。
出现网站 - >输入表单数据 - >点击提交 - >进度图标出现 - >返回带搜索结果的新网页(新数据但url不变)
我的代码:curl -d“postData “-k网址

回答

0

还有,你应该看看几个选项:

--connect-timeout <seconds> 
-m/--max-time <seconds> 
0

我用奇肯富特1.0.7,Firefox扩展,解决了这个问题。使用Chickenfoot的优点是能够编写浏览器交互脚本,延迟操作并写入文件。但该API有点难以理解。
无论如何,这里是我使用的通用代码。

 
//Type: Javascript 
include("fileio.js"); //Provides the write command.
go(" https://the-url ");
enter(element, desiredInputValue); //Use the "Record actions" option for help
click("Search"); // Clicks the search button to POST.
sleep(9);
write("searchResults.txt", document.body.innerHTML);