Forum

Extract social webs...
 
Notifications
Clear all

Extract social websites

7 Posts
2 Users
0 Reactions
52 Views
(@marsil)
Posts: 72
Estimable Member
Topic starter
 

Hello,

Please can you check why attached macro not work in all websites to get social websites.

Ex:  https://www.myonlinetraininghub.com/

      https://www.maximintegrated.com/

Thanks;

Marsil

 
Posted : 16/02/2021 7:10 pm
(@catalinb)
Posts: 1937
Member Admin
 

Use Debug.Print to see the response, after the line:
HTML.body.innerHTML = http.responseText

Debug.Print  http.responseText

You'll have an idea of what the site returns.

 
Posted : 19/02/2021 12:55 am
(@marsil)
Posts: 72
Estimable Member
Topic starter
 

Hi Catalin,

How kind you are to help me. thank you.

I added " Debug.Print  http.responseText " after this line  " HTML.body.innerHTML = http.responseText "

but still face the macro no result for https://www.myonlinetraininghub.com/ and https://www.maximintegrated.com/

Please can you review code for attached macro.

Grateful for your support...

Thanks;

Marsil

 
Posted : 20/02/2021 12:22 pm
(@catalinb)
Posts: 1937
Member Admin
 

Have you studied the printed response from those websites?

 
Posted : 20/02/2021 2:35 pm
(@catalinb)
Posts: 1937
Member Admin
 

Try another method:

Sub GetWebPageLinks()
Dim appIE As Object, itm As Variant
Dim objCollection As Object
Dim i As Long, LastRow As Long
Dim sURL As String

LastRow = Range("A" & Rows.Count).End(xlUp).row

For i = 24 To LastRow
Set appIE = New InternetExplorer

sURL = Range("A" & i).Value
With appIE
.navigate sURL
.Visible = True
End With
On Error GoTo 1
Do While appIE.Busy Or appIE.readyState <> READYSTATE_COMPLETE
DoEvents
Loop

Set objCollection = appIE.document.getElementsByTagName("a")
For Each itm In objCollection
Debug.Print itm.innerText
Next itm
appIE.Quit
Set appIE = Nothing
2:
Next i
Exit Sub
1:
Resume 2
End Sub

 
Posted : 20/02/2021 3:23 pm
(@marsil)
Posts: 72
Estimable Member
Topic starter
 

Hi Catalin,

That's a huge help - thanks!

Unfortunately, I confused and macro doesn't work, please can you update this code in excel file and resend it.

Thank you very much; your support is greatly appreciated.

Thanks;

Marsil

 
Posted : 20/02/2021 5:23 pm
(@catalinb)
Posts: 1937
Member Admin
 

File attached.

 
Posted : 20/02/2021 11:56 pm
Share: