2,722
社区成员
发帖
与我相关
我的任务
分享
PUBLIC lncount,roothtml,imghtml,lccover,lccoverurl
lncount = 0
imghtml = ''
roothtml = '<html><head><link rel="stylesheet" type="text/css" href="..\css\main.css"><meta http-equiv="expires" content="60">'+'<meta http-equiv="content-type" content="text/html;charset=utf-8"><meta name="keywords" content="美女,性感,写真,诱惑,大尺度,丝袜"><title>Beautiful Girl!!!</title></head><body><ul>'
IF !DIRECTORY('.\img')
MKDIR('.\img')
ENDIF
IF !DIRECTORY('.\cover')
MKDIR('.\cover')
ENDIF
IF !DIRECTORY('.\html')
MKDIR('.\html')
ENDIF
FOR pg = 1 TO 2 &&这个地方可以将100分成10等分,然后编译出10个EXE,利用多进程,加快爬去速度。
lnnum = 30
IF pg < 2
lcpgurl = 'https://www.nvshens.com/gallery/yazhou'
ELSE
lcpgurl = 'https://www.nvshens.com/gallery/yazhou/'+ALLTRIM(STR(pg))+'.html'
ENDIF
LOCAL oxhttp AS Microsoft.xmlhttp
oxhttp=CREATEOBJECT("Microsoft.xmlhttp")
oxhttp.OPEN("GET",lcpgurl,.F.)
oxhttp.SEND()
SourceCode=STRCONV(oxhttp.responseBody,11)
RELEASE oxhttp
FOR a = 1 TO lnnum
lchtml = 'https://www.nvshens.com'+STREXTRACT(SourceCode,"'><a href='","' class='caption'>",a)
lccoverurl = "https://t1.onvshen.com:85/gallery/" + STREXTRACT(SourceCode,"https://t1.onvshen.com:85/gallery/","'",a)
IF (lchtml == "") = .F.
LOCAL oxhttp1 AS Microsoft.xmlhttp
oxhttp1=CREATEOBJECT("Microsoft.xmlhttp")
oxhttp1.OPEN("GET",lchtml,.F.)
oxhttp1.SEND()
SourceCode1=STRCONV(oxhttp1.responseBody,11)
lnpicnum = VAL(STREXTRACT(SourceCode1,"#DB0909'>","张照片",1))
lcfolder = ALLTRIM(STREXTRACT(SourceCode1,'<title>','</title>',1))
lcfolder = STRTRAN(lcfolder,'_宅男女神','')
lcfolder = STRTRAN(lcfolder,'图片','')
lcfolder = STRTRAN(lcfolder,'|','')
lcfolder = STRTRAN(lcfolder,'<','')
lcfolder = STRTRAN(lcfolder,'>','')
lcfolder = STRTRAN(lcfolder,'/','')
lcfolder = STRTRAN(lcfolder,'\','')
lcfolder = STRTRAN(lcfolder,':','')
lcfolder = STRTRAN(lcfolder,'"','')
lcfolder = STRTRAN(lcfolder,'*','')
lcfolder = STRTRAN(lcfolder,'?','')
IF ("404" $ lcfolder) = .F.
imghtml = imghtml + '<html><head><link rel="stylesheet" type="text/css" href="..\..\css\main.css"><meta http-equiv="expires" content="60"><meta http-equiv="content-type" content="text/html;charset=utf-8"><meta name="keywords" content="美女,性感,写真,诱惑,大尺度,丝袜"><title>'+lcfolder+'</title></head><body>'
lncount = lncount + 1
IF !DIRECTORY('.\img\'+lcfolder)
MKDIR('.\img\'+lcfolder)
ELSE
lcfolder = lcfolder + '_NEW'
MKDIR('.\img\'+lcfolder)
ENDIF
lcpicurlbase = STREXTRACT(SourceCode1,"<img src='","0.jpg",1)
RELEASE oxhttp1
****************获取cover******************
LOCAL oxhttp1 AS Microsoft.xmlhttp
oxhttp1=CREATEOBJECT("Microsoft.xmlhttp")
oxhttp1.OPEN("GET",lccoverurl,.F.)
oxhttp1.SEND()
STRTOFILE(oxhttp1.responseBody,".\cover\" + lcfolder + ".jpg")
RELEASE oxhttp1
*******************************************
FOR b = 1 TO lnpicnum
IF b < 2
lcpicurl = lcpicurlbase + "0.jpg"
ELSE
DO CASE
CASE b < 11
lcpicurl = lcpicurlbase + '00' + ALLTRIM(STR(b-1)) + '.jpg'
CASE b < 101
lcpicurl = lcpicurlbase + '0' + ALLTRIM(STR(b-1)) + '.jpg'
OTHERWISE
lcpicurl = lcpicurlbase + ALLTRIM(STR(b-1)) + '.jpg'
ENDCASE
ENDIF
LOCAL oxhttp2 AS Microsoft.xmlhttp
oxhttp2=CREATEOBJECT("Microsoft.xmlhttp")
oxhttp2.OPEN("GET",lcpicurl,.F.)
oxhttp2.SEND()
IF !ISNULL(oxhttp2.responseBody)
STRTOFILE(oxhttp2.responseBody,'.\img\'+lcfolder+'\'+ALLTRIM(STR(b))+'.jpg')
imghtml = imghtml + '<p align="center"><img src="..\img\'+lcfolder+'\'+ALLTRIM(STR(b))+'.jpg"'+' alt="'+'jpg'+ALLTRIM(STR(b))+'"></p>'
ENDIF
RELEASE oxhttp2
ENDFOR
imghtml = imghtml + '<p align="center"><a href="..\beauty.html">返回</a></p></body></html>'
STRTOFILE(STRCONV(imghtml,9),'.\html\'+ALLTRIM(STR(lncount))+'.html')
imghtml = ''
roothtml = roothtml + '<li class="pic"><div class="pic_div"><a class="pic_link" href="' + '.\html\'+ALLTRIM(STR(lncount))+'.html';
+'" target="view_window"><img alt="'+lcfolder+'" src="'+'.\cover\'+lcfolder+'.jpg'+'" title="'+lcfolder+'" /></a></div><div class="pic_title"><a href="';
+'.\html\'+ALLTRIM(STR(lncount))+'.html'+'" target="view_window" class="caption">'+lcfolder+'</a></div></li>'
ENDIF
ENDIF
ENDFOR
ENDFOR
roothtml = roothtml + '</ul></body></html>'
STRTOFILE(STRCONV(roothtml,9),'.\beauty.html')
MESSAGEBOX("All done!!",48,"Tips")