Hi Guys,
I have the below VBA which opens a postcode finder website and enters in an address, I then need to copy the returned postcode from the site to my excel workbook. This the part I am struggling with...
HTML CODE
I have the below VBA which opens a postcode finder website and enters in an address, I then need to copy the returned postcode from the site to my excel workbook. This the part I am struggling with...
VBA Code:
Sub PostCode()
Dim URL As String
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Dim HWNDSrc As Long
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
URL = "https://postcodefinder.net"
IE.Navigate URL
IE.document.getElementsByName("val")(0).Value = Range("P2")
IE.document.forms(0).submit
Range("A1") = IE.document.getElementsByClassName("postcode")(1).innerText
End Sub
HTML CODE
VBA Code:
<div class="postcode">Postcode: <b>EH4 4HF</b></div>