Import data from multiple pages of a website into excel?

2.1k Views Asked by At

I want to auto fetch data from various web pages of a single website . The link is the same but just the last number changes like this : http://reo-agents.net/agents/1 the link remains the same just the end number changes till 953157. As there are 953157 records total.

I just want to import the name, email & phone number and format it properly LIKE separate column for name ,email & cell phone . I just saw few tutorials on it and did a macro recording but was unable to get a working solution. Here is the macro for it

Sub Macro1()
'
' Macro1 Macro
'

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://reo-agents.net/agents/1", Destination:=Range("$A$1"))
        .Name = "1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
    ActiveWindow.SmallScroll Down:=21
End Sub

How do I automate this?

0

There are 0 best solutions below