Excel get data from multiple web pages

In this article, I will show you how to extract data from multiple web pages into Excel. While working on an Excel worksheet, sometimes you may need to extract data from a web page. Sometimes you may need to extract data from multiple web pages. In this article, I will show you step-by-step procedures to extract data from multiple web pages into Excel. Follow the steps carefully to increase your excel skills.


Table of Contents hide

Download Practice Workbook

Step-by-Step Procedures to Extract Data from Multiple Web Pages into Excel

Step 1: Connect to the Web

Step 2: Open Power Query Editor

Step 3: Edit Query Using Advanced Editor

Step 4: Add Custom Column

Step 5: Remove Prefix from Extracted Data

Step 6: Final Result

Things to Remember

Conclusion

Related Articles

Download Practice Workbook

Please download the workbook to practice yourself.

Extract Data to Excel.xlsx


Step-by-Step Procedures to Extract Data from Multiple Web Pages into Excel

Here, you can see the dataset I will consider for this article. The dataset has two columns, B and C called Year and URL. The dataset is about Hollywood movie data at the box office. I will use those URLs to extract data from multiple web pages into Excel following the steps given below.

Excel get data from multiple web pages


Step 1: Connect to the Web

This is the first and essential step of the whole procedure. I will connect the dataset to the web.

  • First, select the C5 cell and copy the URL.

Excel get data from multiple web pages

  • Then, go to the Data tab in your toolbar.
  • After that, select the From Web option.

Excel get data from multiple web pages

  • Hence, a window will show up.
  • Then, paste the copied URL and press Ok.

Excel get data from multiple web pages

Read More: How to Scrape Data from a Website into Excel (2 Easy Methods)


Step 2: Open Power Query Editor

In this step, I will open the power query editor. Here, the power query editor will help me to navigate data and open the table in a selected cell. Follow the following procedures.

  • When the Navigator tab is opened, you can preview the table on the right side of the tab.
  • Then, click on the Transform Data option.

Excel get data from multiple web pages

  • Then, in the Query Settings bar, select the Name option.

Excel get data from multiple web pages

  • Then, change the name to Movies.

Excel get data from multiple web pages

  • Moreover, go to the Home tab and select the Close and Load option.
  • Then, from the drop-down menu select the Close and Load To option.

Excel get data from multiple web pages

  • Consequently, a window will pop up.
  • Then, select the Existing worksheet option.
  • Meanwhile, press Ok.

Excel get data from multiple web pages

  • As a result, Excel will show the data table in the E column.

Excel get data from multiple web pages

Read More: How to Import Table from Website to Excel (2 Easy Ways)


Step 3: Edit Query Using Advanced Editor

In this step, I will Edit the query options to extract data from multiple web pages in excel. Follow the following steps one by one.

  • From the Queries and Connections bar, select the Movies1 option.
  • Then, right–click on the option.
  • After that, select the Edit option.

Excel get data from multiple web pages

  • After that, select the Advanced Editor option.

Excel get data from multiple web pages

  • You will find the following window.

Excel get data from multiple web pages

  • Replace the code with the following code.
(URL) as table =>
let
Source = Web.Page(Web.Contents(URL)),
Data1 = Source{1}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data1,{{"Header", type text}, {"Weight class", type text}, {"", type text}, {"2", type text}, {"3", type text}, {"Method", type text}, {"Round", Int64.Type}, {"Time", type time}, {"Notes", type text}})
in
#"Changed Type"

Excel get data from multiple web pages

  • Then, the following window will appear. We will let the window remain the same.

Excel get data from multiple web pages

  • Change the name of the function to fxMovies1.

Excel get data from multiple web pages

  • After that, click on the Close and Load option.

Excel get data from multiple web pages

  • As a result, you will find the function fxMovies1.

Excel get data from multiple web pages

Read More: Excel VBA to Scrape Table from Website (With Easy Steps)


Step 4: Add Custom Column

In this step, I will add a custom column. Follow the steps described serially. If there is any problem, have a look at the illustrations.

  • First, select any of the cells of the C cell.
  • Then, go to the Data tab and under Get and Transform Data option, select the From Table or Range option also.

Excel get data from multiple web pages

  • Consequently, Excel will show the following table.

Excel get data from multiple web pages

  • Then, go to the Add Column option.
  • After that, select the Custom Column option.

Excel get data from multiple web pages

  • Then, a window will show up.
  • Change the new column name into FetchMovies.
  • Then, write the following custom column formula.

=fxMovies1([URL])

  • Hence, press Ok.

Excel get data from multiple web pages

  • Then, this window will show up.
  • Select the Continue button here.

Excel get data from multiple web pages

  • In the Privacy Levels window, select the option shown in the image.
  • Then save it.

Excel get data from multiple web pages

  • As a result, Excel will show the following table. Click the indicated icon then.

Excel get data from multiple web pages

Read More: Automated Data Scraping from Websites into Excel


Step 5: Remove Prefix from Extracted Data

In this portion of this article, I will show how to remove prefixes from the data table. Follow the following procedures.

  • Uncheck the option shown in the following picture.
  • Then, press the Ok option.

Excel get data from multiple web pages

  • Then, Excel will show the following table in preview.

Excel get data from multiple web pages

  • Meanwhile, in the Home tab, select the Close and Load option.

Excel get data from multiple web pages

Read More: How to Use Web Scraping with Excel VBA (3 Suitable Examples)


Step 6: Final Result

Here, I will show the final result. Hopefully, you have found interest in the whole procedure.

  • At last, you will see all the movie names after the Close & Load command. Here, I’m showing you a segment of the movie list as I cannot fit all of them in one picture.

Excel get data from multiple web pages

This is the total process to extract data from multiple web pages into Excel.


Things to Remember

  • You should be more careful to follow the entire steps as the steps are lengthy.

Conclusion

In this article, I have tried to explain how to extract data from multiple web pages into Excel. I hope, you have learned something new from this article. Now, extend your skill by following the steps of these methods. You will find such interesting blogs on our website Exceldemy.com. I hope you have enjoyed the whole tutorial. If you have any queries, feel free to ask me in the comment section. Don’t forget to give us your feedback.

How do I get data from multiple websites in Excel?

Go to the View tab and press the Advanced Editor button. This will allow us to edit the code that Excel has created to extract the data from this URL..
A list of tables available to import from the webpage will be listed. ... .
A preview of our selected data will appear..
Press the Edit button..

Can you scrape data from multiple websites?

You can observe whether the website URLs you want to scrape has the same characters or parameters. Octoparse can scrape data from multiple web pages that share similar layout or many website URLs that are organized as a logical sequence by using “URL list Loop”. There are only 4 steps to scrape multiple URLs.

Can Excel automatically pull data from a website?

Except for transforming data from a web page manually by copying and pasting, Excel Web Queries are used to quickly retrieve data from a standard web page into an Excel worksheet. It can automatically detect tables embedded in the web page's HTML.

How do I scrape data from a website into Excel?

Using Web Queries in Excel.
Open Excel and create a new workbook..
Select the "Data" tab and select "From Web"..
Enter the website address where you want to scrape data in the "Address" field..
Click on the "Go" button..
Select the table you want to scrape data from and click on the "Import" button..