I'm trying to use VBA for web scrapping (★ Dream Catcher Home Stay, Cochin, India) and get numerical value for "b_hotel_id" line in the code below
but I don't know how to refer to it, as there is no ID or TAG. This data is hidden from website and visible only in the source code.
I was trying to fetch the data using this VBA code:
Could you please help?
Code:
<td class="line-number" value="568"></td>
<td class="line-content">b_hotel_id: '554615',</td>
but I don't know how to refer to it, as there is no ID or TAG. This data is hidden from website and visible only in the source code.
I was trying to fetch the data using this VBA code:
VBA Code:
Public Sub GetValueFromBrowser()
Dim ie As Object
Dim url As String
Dim bkid As String
url = "https://www.booking.com/hotel/in/dream-catcher-home-stay.en-gb.html"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = 0
.navigate url
While .Busy Or .readyState <> 4
DoEvents
Wend
End With
Dim Doc As HTMLDocument
Set Doc = ie.document
bkid = Trim(Doc.getElementsByName("b_hotel_id:")(0).Value)
Range("A1").Value = bkid
End Sub
Could you please help?