How to get text from class inside webpage with the same class name but with different value VB.NET

  • Thread starter Thread starter Mostafa Salaheldien
  • Start date Start date
M

Mostafa Salaheldien

Guest
Hello every one,

this is my first question here

and i would like to have text from class it has the same name

I want to get all the price


the code i have its only bring to me the last price

first price will be in Texbox1

second price will be in textbox2 .. etc

For Each Element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
If Element.GetAttribute("className") = "hprt-price-block " Then
For Each Element1 As HtmlElement In Element.GetElementsByTagName("div")
If Element1.GetAttribute("className") = "bui-price-display__value prco-ltr-center-align-helper prco-font16-helper" Then
Dim Variable1 As String = Element1.InnerText
TextBox2.Text = Element1.InnerText

End If
Next
End If

Next

and this is the table


</td>
<td class="hprt-table-cell hprt-table-cell-price">
<div class="hprt-price-block ">
<div class="hprt-price-deal-badge">
</div>
<div class="prco-wrapper bui-price-display prco-sr-default-assembly-wrapper prc-d-sr-wrapper">
<div class="bui-price-display__value prco-ltr-center-align-helper prco-font16-helper" aria-hidden="false">
100 $$
</div>
<td/>
+++++++++++++++++++++++++++++++++
</td>
<td class="hprt-table-cell hprt-table-cell-price">
<div class="hprt-price-block ">
<div class="hprt-price-deal-badge">
</div>
<div class="prco-wrapper bui-price-display prco-sr-default-assembly-wrapper prc-d-sr-wrapper">
<div class="bui-price-display__value prco-ltr-center-align-helper prco-font16-helper" aria-hidden="false">
200 $$
</div>
<td/>
++++++++++++++++++++++++++++++++++++
</td>
<td class="hprt-table-cell hprt-table-cell-price">
<div class="hprt-price-block ">
<div class="hprt-price-deal-badge">
</div>
<div class="prco-wrapper bui-price-display prco-sr-default-assembly-wrapper prc-d-sr-wrapper">
<div class="bui-price-display__value prco-ltr-center-align-helper prco-font16-helper" aria-hidden="false">
300 $$
</div>
<td/>


How to do it with my code

Thanks in adanvce

Continue reading...
 

Similar threads

Back
Top