Home > Software engineering >  Fill in the form for help with VBA crawl web data
Fill in the form for help with VBA crawl web data

Time:11-17

Want to crawl web site source code value="https://bbs.csdn.net/topics/47174" fill in the form of the digital part of the cell, but modern code only get staff name, unable to climb in the part of the value, how to modify the code well,
Sub web page to extract the data ()
On the Error Resume Next
Dim m
M=1
With CreateObject (" internetexplorer. Application ")
The Visible=True
"Navigate https://www2.daikokudrug.com/timecard/shift/create1week/? Shift - week=2019-31 & amp; Shop - code=32 "
Do Until the ReadyState=4
DoEvents
Loop
The Set r=. Document. All tags (" li ")
For I=0 To r.L ength - 1
T=r (I). The classname
If r (I). The classname="code" Then
Cells (m, 1)=r (I). The innerText
M=m + 1
End the If
Next

End With
End Sub

CodePudding user response:

In the code Set r=. Document. All the tags (" li ") into a Set r=. Document. All the tags (" li ")

CodePudding user response:

The Set r=in the code. The document. All the tags (" li ") into a Set r=. Document. All the tags (" input ")
Also cannot solve the problem, could you tell me how to extract the value of the part?

CodePudding user response:

Try this:
 
The set r=. Document. Getelementsbytagname (" li ")
  •  Tags:  
  • VBA
  • Related