Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

VS 2008 Set attribute.

$
0
0
Hi there, I am trying to get the attribute "onclick" from a webpage. This is the whole html thing I'm trying to change :
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

I just want to replace something and keep the product ID. Any clue?

Viewing all articles
Browse latest Browse all 42220

Trending Articles