Home > Software engineering >  VB how to capture the contents of the two different string
VB how to capture the contents of the two different string

Time:09-16

The interception of a web page in the content of the div, for example, assume that the div inside there is a list of li, the li again inside the content and the content of each attribute to intercept down respectively

CodePudding user response:


Dim h1 As HtmlElement
Dim h2 As HtmlElement
Dim STR As String
H1=WebBrowser1. Document. GetElementsByTagName (" div ") (0) 'capture page div
For I As Int16=0 To h1. GetElementsByTagName (" li "). The Count - 1
The h2=h1. GetElementsByTagName (" li ") (I)
STR=h2. InnerHtml 'inside the li content and each attribute content intercept down
STR=h2. GetAttribute (" name "), "the li content and each attribute content inside the interception down
Next

CodePudding user response:

If you don't understand, can write more specific questions,

CodePudding user response:

Is this, intercepting a attribute of large div, but div only by setting up inside the class attribute to determine the first and the back of the intercept div (each class attribute is not the same as no law and it also has a lot of div)

CodePudding user response:

CodePudding user response:

You can look at the two articles I
VB use XML to implement online translation example
VB to analysis the content of more than 64 k (based on XMLHTTP and byte array processing)

CodePudding user response:

According to the law and then write code, will be regular words can get twice the result with half the effort,
  • Related