aardio string.match匹配html
视图:
代码:
get_ipcity=function(){
import inet.http
var http=inet.http()
var str=http.down("https://4dn.net/jsxx/268.html")
string.save("c:\ip.txt",str )
var title = /*class=\"post-title\">\<span class=\"fa fa-code\"\>\</span\>(.*?)\</h2\>*/
var href = /*class=\"cat\" href=\"(.*?)\"\>(.*?)\</a\>*/
var title=string.match(str,title)
var href=string.match(str,href)
http.close()
return title,href;
}
io.open()
title,href=get_ipcity()
io.print("获取名称是:",title)
io.print("获取链接是:",href)
execute("pause")
io.close()
黑蜘蛛