Hello from Naples Italy, I need help to develop an application that
fill fields automatically in a WEB page and then submit the request. I
really need it for getting automatically rates from low cost airline
but I am testing it with Google. I am writing the following code in
VB.net
AxWebBrowser1.Navigate("http://www.google.com")
doc = Me.AxWebBrowser1.Document 'Get htmldocument
Dim ricerca As mshtml.HTMLInputTextElement =
doc.getElementsByName("q").item(, 0) 'get inputbox ref
ricerca.value = "Italy" 'Input value
Dim submitButton As mshtml.HTMLInputButtonElement =
doc.getElementsByName("btng").item(, 0)
submitButton.click() 'click the button
I get this error on the last line: An unhandled exception of type
'System.NullReferenceException' occurred in WindowsApplication1.exe
Additional information: Object reference not set to an instance of an
object
Is there anyone who can help me?
Thanks in advance.
Luca