错误424-需要通过选择网站上的某些数据来获取价格

时间:2019-05-06 05:23:53

标签: excel web web-scraping

我正在尝试从网站上获取特定型号和特定城市的S-cross型号的价格。使用excel marcro选择数据后,我想获取该模型的价格。我已经编写了打开网站并输入所需数据的代码,但显示错误424

请在下面找到所需的代码

'启动一个名为SearchBot的新子例程 子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

我希望代码能打开网站并选择模型作为孟买城市的Smart Hybrid Delta。但是,我无法这样做。

任何帮助将不胜感激。

0 个答案:

没有答案