I am new to the forum. Please excuse any errors on my part...I am trying to log into a web site, post a number into the entry field, click on a lookup button and then retrieve information off of the new page. I know excel quite well and VBA less so. I have never attempted this sort of thing using Excel, but have found code out there that works for other sites. Unfortunately it does not seem to for mine. If have posted the code below - any help would be appreciated. There is some lines in there that are commented out, mostly trial and error stuff that failed. Thanks. There could be some sort of timeout problem?
Sub SearchBot()
'dimension (declare or set aside memory for) our variables
Dim objIE As InternetExplorer 'special object variable representing the IE browser
Dim aEle As HTMLLinkElement 'special object variable for an <a> (link) element
Dim y As Integer 'integer variable we'll use as a counter
Dim result As String 'string variable that will hold our result link
'initiating a new instance of Internet Explorer and asigning it to objIE
Set objIE = New InternetExplorer
'make IE browser visible (False would allow IE to run in the background)
objIE.Visible = True
objIE.Top = 0
objIE.Left = 50
objIE.Height = 1500
objIE.Width = 2400
'navigate IE to this web page (a pretty neat search engine really)
'objIE.navigate "Club Login - The Club at Mediterra"
objIE.navigate "GHIN.com Handicap Lookup"
'objIE.navigate "DuckDuckGo — Privacy, simplified."
'wait here a few seconds while the browser is busy
'Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
Do While (objIE.Busy Or objIE.readyState = 4)
DoEvents
Loop
objIE.document.getElementsByName ("ctl00_bodyMP_tcLookupModes_tpSingle_tbGHIN")
'Set ghin_no = objIE.document.getElementById("ctl00_bodyMP_tcLookupModes_tpSingle_tbGHIN")
'Debug.Print "Here"; result
'Application.Wait (Now + TimeValue("0:00:03"))
'objIE.document.getElementById("search_form_input_homepage").Value = _
'Sheets("Sheet1").Range("A2").Value & " in " & Sheets("Sheet1").Range("C1").Value
objIE.document.getElementById("ctl00_bodyMP_tcLookupModes_tpSingle_tbGHIN").Value = _
Sheets("Sheet2").Range("B1").Value
'click the 'go' button
objIE.document.getElementById("ctl00$bodyMP$tcLookupModes$tpSingle$btnSubmit1").Click
Sub SearchBot()
'dimension (declare or set aside memory for) our variables
Dim objIE As InternetExplorer 'special object variable representing the IE browser
Dim aEle As HTMLLinkElement 'special object variable for an <a> (link) element
Dim y As Integer 'integer variable we'll use as a counter
Dim result As String 'string variable that will hold our result link
'initiating a new instance of Internet Explorer and asigning it to objIE
Set objIE = New InternetExplorer
'make IE browser visible (False would allow IE to run in the background)
objIE.Visible = True
objIE.Top = 0
objIE.Left = 50
objIE.Height = 1500
objIE.Width = 2400
'navigate IE to this web page (a pretty neat search engine really)
'objIE.navigate "Club Login - The Club at Mediterra"
objIE.navigate "GHIN.com Handicap Lookup"
'objIE.navigate "DuckDuckGo — Privacy, simplified."
'wait here a few seconds while the browser is busy
'Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
Do While (objIE.Busy Or objIE.readyState = 4)
DoEvents
Loop
objIE.document.getElementsByName ("ctl00_bodyMP_tcLookupModes_tpSingle_tbGHIN")
'Set ghin_no = objIE.document.getElementById("ctl00_bodyMP_tcLookupModes_tpSingle_tbGHIN")
'Debug.Print "Here"; result
'Application.Wait (Now + TimeValue("0:00:03"))
'objIE.document.getElementById("search_form_input_homepage").Value = _
'Sheets("Sheet1").Range("A2").Value & " in " & Sheets("Sheet1").Range("C1").Value
objIE.document.getElementById("ctl00_bodyMP_tcLookupModes_tpSingle_tbGHIN").Value = _
Sheets("Sheet2").Range("B1").Value
'click the 'go' button
objIE.document.getElementById("ctl00$bodyMP$tcLookupModes$tpSingle$btnSubmit1").Click