我使用Greasemonkey从页面中捕获了数据列表.
GM脚本
- var hit = GM_getValue("hit") || 0;
- var _url = "http://localhost:8080/test?p=$$pageNo$$";
- _url = _url.replace("$$pageNo$$",hit);
- GM_setValue("hit",++hit);
- if(hit <= 100) {
- window.location.href = _url;
- }
此脚本将运行第n次并捕获< 10K数据,现在我面临将捕获的数据存储在某个文件中的问题.
任何人都知道我们如何将捕获的数据存储到文件/仓库?
谢谢
– Viswanathan G.
解决方法
不,不能将它写入文件,但如果你真的很无聊,你可以将它发布到
http://pastebin.com(或任何其他接受带有一堆数据的POST请求的URL).
- GM_xmlhttpRequest({
- method: "POST",url: "http://pastebin.com/post.PHP",data: <your data here>,headers: {
- "Content-Type": "application/x-www-form-urlencoded"
- },onload: function(response) {
- alert("posted");
- }
- });
请注意,您需要有一个pastebin帐户才能使用该API.