Hi Guys
I am really stuck with this one. I am trying to enter values into the boxes of this site then hit the ok button. Not sure why my code below doesnt work though. Any ideas?
------------------------------------------------------------------------------------------------------------------------------------------
Sub TestMethod()
MySourceCode = Scraper.WebBrowser1.DocumentText
WebBrowser1.Navigate("https://b2b.ewe-gasspeicher.de/GasXLastfluss/")
If InStr(MySourceCode, "Standort") <> 0 Then
AllElements = Scraper.WebBrowser1.Document.All
For Each cbat As HtmlElement In AllElements
' 'check date
If cbat.GetAttribute("name") = "ASPxStartDate_I" Then cbat.SetAttribute("value", "06.07.2013")
If cbat.GetAttribute("id") = "ASPxNetzPunkt_I" Then cbat.SetAttribute("value", "Nuettermoor H-Gas GASCADE")
Next
AllElements = Scraper.WebBrowser1.Document.All
For Each cbat As HtmlElement In AllElements
'check date
If cbat.GetAttribute("id") = "ASPxOK" Then
If OneClick = False Then
cbat.InvokeMember("click")
OneClick = True
End If
End If
Next
End If
End Sub
I am really stuck with this one. I am trying to enter values into the boxes of this site then hit the ok button. Not sure why my code below doesnt work though. Any ideas?
------------------------------------------------------------------------------------------------------------------------------------------
Sub TestMethod()
MySourceCode = Scraper.WebBrowser1.DocumentText
WebBrowser1.Navigate("https://b2b.ewe-gasspeicher.de/GasXLastfluss/")
If InStr(MySourceCode, "Standort") <> 0 Then
AllElements = Scraper.WebBrowser1.Document.All
For Each cbat As HtmlElement In AllElements
' 'check date
If cbat.GetAttribute("name") = "ASPxStartDate_I" Then cbat.SetAttribute("value", "06.07.2013")
If cbat.GetAttribute("id") = "ASPxNetzPunkt_I" Then cbat.SetAttribute("value", "Nuettermoor H-Gas GASCADE")
Next
AllElements = Scraper.WebBrowser1.Document.All
For Each cbat As HtmlElement In AllElements
'check date
If cbat.GetAttribute("id") = "ASPxOK" Then
If OneClick = False Then
cbat.InvokeMember("click")
OneClick = True
End If
End If
Next
End If
End Sub