I should preface this by letting you know I'm not a coder. I'm just a person who knows a little VB.NET and likes efficiency.
I'm working with WebBrowser1.Document.Body.InnerHtml to get the source of the webpage within the webbrowser element, inside the source is this Table Row
<tr>
<td width="60px">
11/04/18 </td>
<td width="80px">
John Smith </td>
<td>
CHARGED_ONBOARDING_FEE - Admin manual charged </td>
</tr>
I can easily check if CHARGED_ONBOARDING_FEE appears in the page with this:
i = WebBrowser1.Document.Body.InnerHtml
If i.Contains("CHARGED_ONBOARDING_FEE") Then
RichTextBox1.AppendText("OB PAID" & vbNewLine)
Else
RichTextBox1.AppendText("NO FEE" & vbNewLine)
End If
However, is there anyway I can extract that date (11/04/18)?
Is it possible to have this workflow or something similar?
1. if exists CHARGED_ONBOARDING_FEE proceed
2. Check backward in string for <td width="60px"> if exists proceed
3. date1 = string between "60px"> and </td>
4. RichTextBox1.AppendText("OB PAID" & " on " & date1 & vbNewLine)
Thanks for any help guys, please go easy on me!
HtmlDocumentcollections of elements. There are some pre-defined collections (Forms, Links, Images...). You can create other collections using the grouping functions provided by theHtmlDocumentobject. See: GetElementsByTagName() for example. Use the Parent-Child relations between the elements to find the descendants of a parent container and navigate the structure. TheTDelements are children of aTRelement, child of aTABLEelement...