Hi, guys
I found some threads about this, but I'm not having success to make this work.
I have a URL and I need to get the text and a specific hyperlink that it is on the end of the post, on the phrase "Veja a matéria" (sorry, it is in portuguese). Then I'd like to paste it on separate cells on the sheet.
I wrote the code below, but it is not working. First time it would catch the link on the cell, copy the content and paste on the cells at the right side, but it didn't work. Now i'm trying to insert the link where the macro should navigate on a inputbox, but it's still not working.
Can anyone help me with this?
Thanks!
Thats the code
Sub teste()
Dim erow As Long
Dim ele As Object
RowCount = 2
erow = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Set objIE = CreateObject("InternetExplorer.application")
myurl = InputBox("Insira a URL")
With objIE
.Visible = True
.navigate "myurl.Value"
Do While .busy Or _
.readystate <> 1
DoEvents
Loop
For Each ele In .document.all
Select Case ele.classname
Case "toplink"
RowCount = RowCount + 1
End Select
Next ele
End With
Set objIE = Nothing
End Sub
I found some threads about this, but I'm not having success to make this work.
I have a URL and I need to get the text and a specific hyperlink that it is on the end of the post, on the phrase "Veja a matéria" (sorry, it is in portuguese). Then I'd like to paste it on separate cells on the sheet.
I wrote the code below, but it is not working. First time it would catch the link on the cell, copy the content and paste on the cells at the right side, but it didn't work. Now i'm trying to insert the link where the macro should navigate on a inputbox, but it's still not working.
Can anyone help me with this?
Thanks!
Thats the code
Sub teste()
Dim erow As Long
Dim ele As Object
RowCount = 2
erow = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Set objIE = CreateObject("InternetExplorer.application")
myurl = InputBox("Insira a URL")
With objIE
.Visible = True
.navigate "myurl.Value"
Do While .busy Or _
.readystate <> 1
DoEvents
Loop
For Each ele In .document.all
Select Case ele.classname
Case "toplink"
RowCount = RowCount + 1
End Select
Next ele
End With
Set objIE = Nothing
End Sub