0
我一直在敲打我的頭靠在牆上,他試圖找出爲什麼這個VBA代碼將無法正常工作:(填寫輸入框的網站使用VBA
我只是試圖插入輸入到Excel中的價值。輸入框到網站的輸入框,我是新手,當涉及到HTML,所以我敢肯定,有什麼關係呢
下面是從網站的HTML元素Zomato.com:
<input class="dark" id="location_input" role="combobox" aria-expanded="true" aria-labelledby="label_search_location" aria-owns="explore-location-suggest" aria-autocomplete="list" placeholder="Please type a location...">
這是我的VBA代碼:
Sub Merchant_Extraction()
Dim IE As Object
Dim form As Variant
Dim button As Variant
Set IE = CreateObject("internetexplorer.application")
merchantzip = InputBox("Enter Zip Code")
With IE
.Visible = True
.navigate ("http://www.zomato.com")
While IE.readystate <> 4
DoEvents
Wend
IE.Document.GetElementByID(「location_input_sp」).Item.innertext = merchantzip
Set form = IE.Document.getelementsbytagname("form")
Set button = form(0).onsubmit
form(0).get
End With
Set IE = Nothing
End Sub
我不清楚它爲什麼不能正常工作 - 任何幫助都是不可思議的!
爲什麼你在刮? [只需使用他們的API](https://developers.zomato.com/documentation)。 – Comintern