Hi there, I am trying to get the attribute "onclick" from a webpage. This is the whole html thing I'm trying to change :
This is how I get it. But it return "system._comobject". ;
I just want to replace something and keep the product ID. Any clue?
HTML Code:
<img onclick="buy_product('7037',1);" class="vam hand" src="/isolation/images/shop_v2/_EN/btn_buy.gif">
This is how I get it. But it return "system._comobject". ;
Code:
Try
Dim PageElement As HtmlElementCollection = wb.Document.GetElementsByTagName("img")
For Each CurElement As HtmlElement In PageElement
If (CurElement.GetAttribute("className")) = "vam hand" Then
MsgBox(CurElement.GetAttribute("onclick"))
' CurElement.SetAttribute("onclick", CurElement.GetAttribute("onclick").Replace("buy_product", "present_product"))
End If
Next
Catch
MsgBox(ErrorToString, MsgBoxStyle.Critical)
End Try