Scrape data from Wikipedia to a Google sheet

Posted on:  09/28/2017

Do you ever have Wikipedia data you need in a spreadsheet?

Using Google Sheets you don't have to copy and paste. Instead, use the ImportHTML function in Google Sheets and get the data from Wikipedia.

Scraping data can save you tons of time. Copy and paste aren't always easy from a web page into a spreadsheet. Google sheets has a function that will pull a Wikipedia table into the worksheet.

The function is ImportHTML

Here is a sample of the function below.

Here is the Wikipedia web page.

There are multiple tables on the webpage.

Some of the tables do not look like tables. Google Sheets icon

Open Google Sheets and put in the function below.

You copy and paste the URL information from Google. Notice the URL and the word table have quotes around them. The number 2 means table number 2.

=ImportHtml("", "table", 2)    

Chris Menard

Chris Menard is a Senior Training Specialist at SurePoint Technologies. Chris is certified in Excel, Word, PowerPoint, and Outlook. Menard has a YouTube channel with other 600 technology videos covering Excel, Word, Zoom, Teams, Outlook, Gmail, Google Calendar, and other resources that over 7 million viewers have very appreciated. Because of Chris's certification and expertise with Microsoft, Chris is a proud member of Microsoft's Creator Team. Being a member of Microsoft's Creator Teams means many of his videos are available on Microsoft 365 YouTube channel and Microsoft support websites.