Google Sheets: Scraping data from the internet - Google News Initiative Skip to main content menu close Resources expand_more EXPLORE BY GOAL Develop audiences Build audiences Increase traffic Engage visitors Digital journalism Digital reporting Storytelling formats Fight misinformation Grow revenue Create revenue models Reader revenue Digital ad revenue EXPLORE BY RESOURCE TYPE Products Trainings Case Studies View all resources Latest Resources Lesson Google Alerts: Stay in the know. Lesson Google Scholar: Access court cases, academic papers and sources. Lesson Advanced Search: Researching with precision. About expand_more Our purpose Impact report help search search close expand_more English (GB) English العربيّة Français Français (Canada) Deutsch हिंदी Bahasa Indonesia Italiano 한국어 日本語 Polski Português Português (Brazil) Español (LatAm) Español ภาษาไทย Türkçe 繁體中文 Tiếng việt My Account Sign In Resources keyboard_arrow_right About keyboard_arrow_right keyboard_arrow_left Resources View Resources EXPLORE BY GOAL Develop audiences keyboard_arrow_down Develop audiences Build audiences Increase traffic Engage visitors Digital journalism keyboard_arrow_down Digital journalism Digital reporting Storytelling formats Fight misinformation Grow revenue keyboard_arrow_down Grow revenue Create revenue models Reader revenue Digital ad revenue EXPLORE BY RESOURCE TYPE Products Trainings Case Studies View all resources keyboard_arrow_left About View About Our purpose Impact report My Account Sign In expand_more English (GB) English العربيّة Français Français (Canada) Deutsch हिंदी Bahasa Indonesia Italiano 한국어 日本語 Polski Português Português (Brazil) Español (LatAm) Español ภาษาไทย Türkçe 繁體中文 Tiếng việt Go to dashboard info info Get started Not sure where to start? Take a short quiz to get personalized recommendations. close 1 2 What's your goal today your can select more than one Reach a large audience Reach a large audience Grow Revenue Others Please select your focus area 2 your can select more than one Reporter Publisher Previous Continue close I'm looking for resources in Select your country Afghanistan Åland Islands Albania Algeria American Samoa Andorra Angola Anguilla Antarctica Antigua and Barbuda Argentina Armenia Aruba Asia Pacific - Regional/Crossborder Australia Austria Azerbaijan Bahamas Bahrain Bangladesh Barbados Belarus Belgium Belize Benin Bermuda Bhutan Bolivia (Plurinational State of) Bonaire, Sint Eustatius and Saba Bosnia and Herzegovina Botswana Bouvet Island Brazil British Indian Ocean Territory Brunei Darussalam Bulgaria Burkina Faso Burundi Cabo Verde Cambodia Cameroon Canada Cayman Islands Central African Republic Chad Chile China Christmas Island Cocos (Keeling) Islands Colombia Comoros Congo Congo (the Democratic Republic of the) Cook Islands Costa Rica Côte d'Ivoire Croatia Cuba Curaçao Cyprus Czechia Denmark Djibouti Dominica Dominican Republic Ecuador Egypt El Salvador Equatorial Guinea Eritrea Estonia Eswatini Ethiopia Europe - Regional/Crossborder Falkland Islands (Malvinas) Faroe Islands Fiji Finland France French Guiana French Polynesia French Southern Territories Gabon Gambia Georgia Germany Ghana Gibraltar Greece Greenland Grenada Guadeloupe Guam Guatemala Guernsey Guinea Guinea-Bissau Guyana Haiti Heard Island and McDonald Islands Holy See Honduras Hong Kong Hungary Iceland India Indonesia Iran (Islamic Republic of) Iraq Ireland Isle of Man Israel Italy Jamaica Japan Jersey Jordan Kazakhstan Kenya Kiribati Korea (the Democratic People's Republic of) Korea (the Republic of) Kosovo Kuwait Kyrgyzstan Lao People's Democratic Republic Latin America - Regional/Crossborder Latvia Lebanon Lesotho Liberia Libya Liechtenstein Lithuania Luxembourg Macao Madagascar Malawi Malaysia Maldives Mali Malta Marshall Islands Martinique Mauritania Mauritius Mayotte Mexico Micronesia (Federated States of) Middle East, Africa, Turkey - Regional/Crossborder Moldova (the Republic of) Monaco Mongolia Montenegro Montserrat Morocco Mozambique Myanmar Namibia Nauru Nepal Netherlands New Caledonia New Zealand Nicaragua Niger Nigeria Niue Norfolk Island North America - Regional/Crossborder North Macedonia Northern Mariana Islands Norway Oman Pakistan Palau Palestine Panama Papua New Guinea Paraguay Peru Philippines Pitcairn Poland Portugal Puerto Rico Qatar Réunion Romania Russian Federation Rwanda Saint Barthélemy Saint Helena, Ascension and Tristan da Cunha Saint Kitts and Nevis Saint Lucia Saint Martin (French part) Saint Pierre and Miquelon Saint Vincent and the Grenadines Samoa San Marino Sao Tome and Principe Saudi Arabia Senegal Serbia Seychelles Sierra Leone Singapore Sint Maarten (Dutch part) Slovakia Slovenia Solomon Islands Somalia South Africa South Georgia and the South Sandwich Islands South Sudan Spain Sri Lanka Sudan Suriname Svalbard and Jan Mayen Sweden Switzerland Syrian Arab Republic Taiwan (Province of China) Tajikistan Tanzania, the United Republic of Thailand Timor-Leste Togo Tokelau Tonga Trinidad and Tobago Tunisia Türkiye Turkmenistan Turks and Caicos Islands Tuvalu Uganda Ukraine United Arab Emirates United Kingdom of Great Britain and Northern Ireland United States Minor Outlying Islands United States of America Uruguay Uzbekistan Vanuatu Venezuela (Bolivarian Republic of) Viet Nam Virgin Islands (British) Virgin Islands (U.S.) Wallis and Futuna Western Sahara Yemen Zambia Zimbabwe Go 1 2 3 What’s your goal today? You can select more than one. Strengthen digital journalism Develop your audience Grow your revenue What are you interested in accomplishing? You can select more than one. Which country are you in? Improve your experience by providing the country you’re in Select a country Argentina Australia Austria Bangladesh Belgium Bhutan Bolivia (Plurinational State of) Bosnia and Herzegovina Botswana Brazil Brunei Darussalam Bulgaria Burkina Faso Burundi Cabo Verde Cambodia Cameroon Canada Chile Colombia Congo Congo (the Democratic Republic of the) Costa Rica Croatia Cyprus Czechia Côte d'Ivoire Denmark Dominican Republic Ecuador Egypt El Salvador Estonia Ethiopia Fiji Finland France Georgia Germany Ghana Greece Guatemala Honduras Hong Kong Hungary Iceland India Indonesia Iraq Ireland Israel Italy Japan Jordan Kenya Korea (the Republic of) Kosovo Latvia Lebanon Liberia Lithuania Luxembourg Malaysia Maldives Mali Malta Mexico Middle East, Africa, Turkey - Regional/Crossborder Mongolia Montenegro Morocco Myanmar Namibia Nepal Netherlands New Zealand Nicaragua Niger Nigeria North Macedonia Norway Oman Pakistan Palestine Panama Papua New Guinea Paraguay Peru Philippines Poland Portugal Qatar Romania Rwanda Samoa Saudi Arabia Serbia Sierra Leone Singapore Slovakia Slovenia Solomon Islands South Africa Spain Sri Lanka Sweden Switzerland Syrian Arab Republic Taiwan (Province of China) Thailand Timor-Leste Togo Tonga Tunisia Türkiye Uganda Ukraine United Arab Emirates United Kingdom of Great Britain and Northern Ireland United States of America Uruguay Vanuatu Venezuela (Bolivarian Republic of) Viet Nam Zimbabwe Other Submit Loading... Continue XXXX Lessons XXXX Minutes Back We have recommended resources for you Save results and track your progress Sign in Go to dashboard open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account open_in_new TITLE LABEL1 LABEL2 DESCRIPTION arrow_outward bookmark bookmark_border Remove from your account Save to your account Want to see more? View Resources close close Welcome to the Google News Initiative The Google News Initiative works with publishers and journalists to fight misinformation, share resources, and build a diverse and innovative news ecosystem. Learn more Our most popular resources 1 Lesson Verification: Google Image Search 2 Lesson Google Historical Imagery: Google Earth Pro, Maps and Timelapse 3 Lesson Google News Archive: Access the past. No Results Found We couldn't find what you are looking for Load More chevron_left Data Journalism Lesson 9 of 13 Google Sheets: Scraping data from the internet close Data Journalism check_box check_box_outline_blank Google Trends: See what’s trending across Google Search, Google News and YouTube. check_box check_box_outline_blank Permissions: Source Google Data. check_box check_box_outline_blank Dataset Search Quickstart Guide check_box check_box_outline_blank Public Data Explorer: Access a world of data. check_box check_box_outline_blank Google Trends: Understanding the data. check_box check_box_outline_blank Google Data GIF Maker check_box check_box_outline_blank Google Sheets: Visualizing data check_box check_box_outline_blank Data Source: Global Forest Watch. check_box square Google Sheets: Scraping data from the internet check_box check_box_outline_blank Google Sheets: Cleaning data check_box check_box_outline_blank Data Studio: Make interactive data visualizations check_box check_box_outline_blank Visualizing Data: Introduction to Tilegrams. check_box check_box_outline_blank Visualizing Data: Advanced Tilegrams. Course 0% complete 5 minutes to complete Google Sheets: Scraping data from the internet Build your own data sets using Google Sheets. Learn to build your own data sets using Google Sheets. There is a massive amount of data available on the internet that you can use to research and visualize stories. Finding the data, and getting it into a format you can work with is the first step. Starting a new spreadsheet. Finding reliable data. Importing data to Google Sheets. Troubleshooting and error messages. Displaying your data. For more Data Journalism lessons, visit: https://newsinitiative.withgoogle.com/training/course/data-journalism Starting a new spreadsheet. Starting a new spreadsheet. Step 1 First, you need to create a blank spreadsheet. Go to sheets.google.com. Under Start a new spreadsheet, click the + icon. Step 2 To name your spreadsheet, click the text in the top left corner. Let's name this one "Highest Grossing Movies." Finding reliable data. By sourcing data from government sites, scientific publications, Wikipedia, Google Public Data Explorer and more, you can tell data stories on almost any topic. In this lesson, we’ll practice with data about movies. Step 1 Go to google.com and search highest grossing films. One of the first links should be a Wikipedia entry with multiple tables. One list, called “the top 50 highest-grossing films of all time” cites multiple references, so we will use that one. Always check to make sure you’re scraping data from reliable sources. Step 2 To import this table to Google Sheets, copy the address of the Wikipedia page by highlighting the URL, right clicking on it, and selecting copy. Importing data to Google Sheets. We’ll use importHTML to import the table from Wikipedia to our spreadsheet. This powerful formula is built into Google Sheets to help you import tables or lists from web pages. To learn more about how importHTML works and see examples, read the Google Sheets documentation pages. Step 1 The importHTML tool needs three parameters to work: 1) a URL2) the type of data we’re collecting, either a table or list3) the number representing the position of the table or list in the HTML code. In this example, the first instance of a table would be numbered as one, as the table we want is the first one that shows up in the HTML. You can use trial and error to find what the position of the table is (1, 2, 3, etc.) or right click the webpage, select Inspect > Find to locate the table in the code. Step 2 Go  to the blank sheet you created and navigate to cell A1. Type:=importHTML("https://en.wikipedia.org/wiki/List_of_highest-grossing_films", "table", 1) Step 3 Notice that the URL and the element type (in our case, table) go between quotes — this will make the parameters green. The last parameter is a number not within quotes and it will be colored blue. Troubleshooting and error messages. If you get an ERROR! Message, check to make sure the quotes are double quotes as shown in the example. If you get a VALUE! error, check to make sure you don’t have extra parentheses or quotation marks in the cell. Displaying your data. Once your ImportHTML formula is correct, press enter and give Google Sheets a couple of seconds. The table should load with all the rows and columns formatted. Notice that there are some elements we need to remove so that we can visualize this data. We will learn this in the next lesson, “Google Sheets: Cleaning data.” Congratulations! You completed “Google Sheets: Scraping data from the internet.” To continue building your digital journalism skills and work toward Google News Initiative certification, go to our Training Center website and take another lesson: For more Data Journalism lessons, visit: newsinitiative.withgoogle.com/training/course/data-journalism Congratulations! You've just finished Google Sheets: Scraping data from the internet in progress Recommended for you open_in_new Visualizing Data: Advanced Tilegrams. Lesson Generate your own Tilegram from data. arrow_outward Start bookmark bookmark_border Remove from your account Save to your account None open_in_new How you can use Machine Learning Lesson Understand in what cases ML might be the solution to your problem. arrow_outward Start bookmark bookmark_border Remove from your account Save to your account None open_in_new Learn more about ad blockers Lesson Recover ad revenue lost from ad blockers arrow_outward Start bookmark bookmark_border Remove from your account Save to your account None close How would you rate this lesson? Your feedback will help us continuously improve our lessons! Submit make sure you have visited all the steps before moving forward close mail Sign up for the newsletter to get updates from the Google News Initiative Get the newsletter Contact us Copy the url and share Copy Copied close Privacy Terms help Help Cookies management controls test English (GB) English العربيّة Français Français (Canada) Deutsch हिंदी Bahasa Indonesia Italiano 한국어 日本語 Polski Português Português (Brazil) Español (LatAm) Español ภาษาไทย Türkçe 繁體中文 Tiếng việt close close Leave and lose progress? By leaving this page you will lose all progress on your current lesson. Are you sure you want to continue and lose your progress? Yes, Leave Go Back