怎么打开隐藏文件-错误797
![油猴脚本](/uploads/image/0778.jpg)
2023年4月5日发(作者:tskill)
油猴脚本爬⾍
脚本内容
//==UserScript==
//@name⼤众点评评论爬⾍
//@namespace/
//@version0.1
//@descriptioncrawlisgreate
//@author陈祥安
//@include/shop*
//@match/ajax/json/shopDynamic/allReview*
//@require/jquery/1.11.2/
//@grantGM_xmlhttpRequest
//==/UserScript==
(function(){
var$x=function(xpath,context){
varnodes=[];
try{
vardoc=(context&&ocument)||nt;
varresults=te(xpath,context||doc,null,_TYPE,null);
varnode;
while(node=eNext()){
(node);
}
}catch(e){
throwe;
}
returnnodes;
}
varserver_url='http://127.0.0.1:9090/comment/'
ntListener('load',(event)=>{
//关闭弹窗
letclose_btn=$(".J-bonus-close")
("准备关闭",close_btn)
if(close_btn){
close_();
}
letli_item_list=$x("//ul[@class='comment-listJ-list']/li[@class='comment-item']/div[@class='content']//p[@class='desc']");
vardataList=[];
li_item_h(v=>{
(v);
({"data":ext})
});
GM_xmlhttpRequest({
method:"POST",
url:server_url,
data:ify({'name':"爬⾍","dataList":dataList}),
onload:function(response){
//这⾥写处理函数
//mentById('text').innerHTML=seText;
(response);
("dataList",dataList);
//();
}
});
});
})();
python代码
#@Author:cxa
#@File:
#@Software:PyCharm
importjson
fromflaskimportFlask,request,render_template
app=Flask(__name__)
@('/')
defindex():
return"
⼤众点评API
"@('/comment/',methods=['GET','POST'])
deflogin():
=='POST':
form_data=_data()
result=(form_("utf-8"))
print(result)
returnresult
@andler(404)
defmiss(e):
returnrender_template(''),404
@andler(500)
deferror(e):
returnrender_template(''),500
if__name__=='__main__':
(host='0.0.0.0',port=9090,debug=True)
更多推荐
油猴脚本
发布评论