Extracting data from webpage to excel

Omar23j

New Member
Joined
Jan 26, 2018
Messages
8
Hello everyone

Basically there are word documents stored on a webpage that I would like to extract information from and put inside an excel table. I already have a code to loop through word documents of a given computer folder path to extract information from them and I want to be able to do the same thing but from a webpage. The code for extracting from a computer folder directory is as follows.

Code:
Sub extract()Dim doclist As String, sPath As String
Dim i As Integer


Set wordapp = CreateObject("Word.Application")


sPath = "path"           '
doclist = Dir(sPath & "*.doc*")


i = 1


Do While doclist <> ""
    Set worddoc = wordapp.documents.Open(sPath & doclist)
    For Each tbl In worddoc.tables
        Cells(i + 1, 1) = Trim(Right(Left(tbl.Cell(1, 2).Range.Text, Len(tbl.Cell(1, 2).Range.Text) - 1), Len(tbl.Cell(1, 2).Range.Text) - 11))
                      
        Cells(i + 1, 2) = Trim(Left(tbl.Cell(6, 2).Range.Text, Len(tbl.Cell(6, 2).Range.Text) - 1))
        i = i + 1
    Next tbl
    worddoc.Close
    Set worddoc = Nothing
    doclist = Dir()
Loop




End Sub


If anyone can help me to modify this code to extract the information from a webpage rather than a computer directory. It would be highly appreciated.
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top