dimanche 5 mai 2019

Error 424 - Need to get price by selecting certain data on website

I am trying to get the price of S-cross model from the website for a particular model and particular city. After selecting the data using excel marcro, i want to get the price of that model. I have written the code to open the website and enter the required data but its showing error 424

Please find below the required code

'start a new subroutine called SearchBot 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

'navigate IE to this web page (a pretty neat search engine really)
objIE.navigate "https://www.nexaexperience.com/s-cross.html"

'wait here a few seconds while the browser is busy
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop


'click the 'go' button
objIE.document.getElementById("car-model") = "Smart Hyrbid Delta"
objIE.document.getElementById("location") = "Mumbai"
objIE.document.getElementById("check price").Click

End Sub

I was expecting the code to open the website and select the model as Smart Hybrid Delta for city Mumbai. However, i was not able to do so.

Any help would be greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire