https://www.csdn.net/qchttps://www.csdn.net/qc
但是一篇一篇查询,显然太繁琐了。于是以下这份提供了爬虫下载分数的功能。但是我爬虫没有学好,当里面的示意图与我电脑实际显示的不同,就不知道如何操作了。
所以我用了一个死办法——使用UITOT 提取每一篇文章的地址,写到EXCEL里,然后读取EXCEL一个一个在查分网站上输入,查询,提取生成的分数,写入
先用数据抓取,提取所有的的编辑链接
提取第一次
Dim objExcelWorkBook,arrayData,temp,sRet,iRet,数字,地址
Rem
objExcelWorkBook = Excel.OpenExcel('''C:\Users\jg2yXRZ\OneDrive\桌面\CSDN.xlsx''',true,"Excel","","")
数组 = UiElement.DataScrap({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"DIV","id":"view-containe"}]},{"ExtractTable":0,"Columns":[{"selecors":[{"tag":"div","index":0,"className":"view-container-blog ","value":"div.view-container-blog","prefix":""},{"tag":"div","index":0,"className":"article_manage_mp view","value":"div.article_manage_mp.view","prefix":">"},{"tag":"div","index":0,"className":"article_manage_list","value":"div.article_manage_list","prefix":">"},{"tag":"div","index":2,"className":"","value":"div:nth-child(2)","prefix":">"},{"tag":"div","value":"div","index":0,"prefix":">"},{"tag":"div","index":0,"className":"list-item-mp-right","value":"div.list-item-mp-right","prefix":">"},{"tag":"div","index":0,"className":"list-item-title","value":"div.list-item-title","prefix":">"},{"tag":"p","index":0,"className":"article-list-item-txt","value":"p.article-list-item-txt","prefix":">"},{"tag":"a","index":0,"className":"","value":"a","prefix":">"}],"props":["text","url"]}]},{"objNextLinkElement":{"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"I","parentid":"view-containe","css-selector":"body>div>div>div>div>div>section>div>div>div>section>section>main>div>div>div>div>div>div>div>div>button>i","idx":1}]},"iMaxNumberOfPage":16,"iMaxNumberOfResult":-1,"iDelayBetweenMS":1000,"bContinueOnError":False})
行数=UBound(数组)
For v = 0 To 行数 step 1
TracePrint(数组[v][1])
数字=DigitFromStr(数组[v][1])
TracePrint(数字)
地址 = "https://blog.csdn.net/reasonsummer/article/details/"&数字
TracePrint(地址)
Excel.WriteCell(objExcelWorkBook,"Sheet1",'A'&v+2,v+1,false)
Excel.WriteCell(objExcelWorkBook,"Sheet1",'B'&v+2,数组[v][0],false)
Excel.WriteCell(objExcelWorkBook,"Sheet1",'C'&v+2,地址,false)
Next
Excel.Save(objExcelWorkBook)
因为有些内容我还没有发布,就手动删除了。
Dim objExcelWorkBook,arrayData,temp,sRet,iRet,数字,地址,objRet,sText,分数1
Rem
objExcelWorkBook = Excel.OpenExcel('''C:\Users\jg2yXRZ\OneDrive\桌面\CSDN.xlsx''',true,"Excel","","")
Delay(1000)
行数=Excel.GetRowsCount(objExcelWorkBook,"Sheet1")
For v = 295 To 行数 step 1
网址=Excel.ReadCell(objExcelWorkBook,"Sheet1",'C'&v,true)
Keyboard.InputText(@ui"输入控件<input>",网址,true,20,10000,{"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 500, "bSetForeground": true, "sSimulate": "message", "bValidate": false, "bClickBeforeInput": false})
Delay(1000)
Mouse.Action(@ui"文本<span>_查询","left","click",10000,{"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [],"sSimulate": "simulate", "bMoveSmoothly": false})
Delay(1000)
文字=LocalOCR.ScreenOCR(@ui"块级元素<div>_30文章质量分30,还有改进空间",{"x":0,"y":0,"width":0,"height":0},"SceneText",10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":true})
TracePrint(文字)
分数=DigitFromStr(文字)
TracePrint(分数)
数字长度=Len(分数)
TracePrint(数字长度)
If 数字长度=4
分数=SubStr(分数,1,2)
TracePrint(分数)
End If
Delay(1000)
Excel.WriteCell(objExcelWorkBook,"Sheet1","D"&v,分数,false)
Keyboard.Press("R", "press", ["Ctrl"],{"iDelayAfter": 300, "iDelayBefore": 200, "sSimulate": "simulate"})
Next
Excel.Save(objExcelWorkBook)
https://blog.csdn.net/reasonsummer/article/details/135776977