I got this awesome code from someone on here which gets the first URL from a list in a worksheet from Internet Explorer. Link is How to extract first Google search result URL?
The code has been working absolutely fine until the last week when I have been getting a "Run-time error '424': Object required" error message. I've not changed the code or done anything:
Option Explicit
Sub tryme()
Dim ie As New InternetExplorer
Dim lastrow As Integer
Dim i As Integer
lastrow = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow
ie.Visible = True
ie.navigate Cells(i, 1)
While ie.Busy Or ie.readyState < 4: DoEvents: Wend
Cells(i, 2).Value = ie.document.querySelector("#search div.r [href*=http]").href
**strong text**
Next
End Sub
What can I do to get it working again?
Thanks