With CreateObject (" Msxml2 XMLHTTP ") 'create XMLHTTP is used to read the web page source code
. Open the "GET", url, False 'page to obtain corresponding source code
. Send 'request
GetURL.=the responseText 'extraction and return the page source code
End With
End the Function
Sub TBXH ()
K=2
The Set MyS=ActiveWorkbook. ActiveSheet
TB=MyS. Cells (K, "J"). The Value
The Do While TB & lt;> "
"Url="http://rate.taobao.com/user-rate-" & amp; TB & amp; ". HTM "
HTM_data (url)
=https://bbs.csdn.net/topics/GetURLSet the RegEx=CreateObject (" vbscript. Regexp ") 'create a regular expression
With RegEx
The Global=True 'Global effective
The MultiLine=True 'multi-line effective
The ignorecase=True 'ignore case when handling this parameter is important (web page)
. The Pattern="javascript: void \ \) (0" "\ & gt; (\ d +) \ & lt;/a \ & gt;" Match the total credit points
If the test (HTM_data) Then 'If it can match to the
T=Val (. The Execute (HTM_data) (0). Submatches (0)) 'extract prestige points
End the If
. The Pattern="\ & amp; amp; Result=1 \ '\ \ & gt; (\ d +) \ & lt;/a \ & gt;" 'match weekly, monthly credit points
If the test (HTM_data) Then 'If it can match to the
T7 has=Val (. The Execute (HTM_data) (0). Submatches (0)) 'credit points extraction weeks
T30=Val (. The Execute (HTM_data) (1) submatches (0)) 'credit points extraction month
End the If
End With
MyS. Cells (K, "S"). The Value=https://bbs.csdn.net/topics/T - MyS. Cells (K, "L"). The Value
MyS. Cells (K, "L"). The Value=https://bbs.csdn.net/topics/T
MyS. Cells (K, "M"). The Value=https://bbs.csdn.net/topics/T7
MyS. Cells (K, "N"). The Value=https://bbs.csdn.net/topics/T30
K=K + 1
TB=MyS. Cells (K, "J")
Loop
MsgBox (" update "+ Str (K - 1) +" a small credit situation!" )
End Sub
everyone a great god, and is the reason why previous update credit at this macro editing content will have a detailed points, why now it will all become zero point update credit?
CodePudding user response:
http://rate.taobao.com/myRate.htm? SPM=a1z02. 1. A2109. D1000377. R6ffEe web source is taobao evaluation managementCodePudding user response:
Estimate you get page source code is not right, clean out treasure a lot of data are loaded through Ajax, you can get through component download is a Lawrence livermore national security framework,