title: A primer on theory-driven web scraping: Automatic extraction of big data from the Internet for use in psychological research.
abstract: The termbig dataencompasses a wide range of approaches of collecting and analyzing data in ways that were not possible before the era of modern personal computing. One approach to big data of great potential to psychologists is web scraping, which involves the automated collection of information from webpages. Although web scraping can create massive big datasets with tens of thousands of variables, it can also be used to create modestly sized, more manageable datasets with tens of variables but hundreds of thousands of cases, well within the skillset of most psychologists to analyze, in a matter of hours. In this article, we demystify web scraping methods as currently used to examine research questions of interest to psychologists. First, we introduce an approach called theory-driven web scraping in which the choice to use web-based big data must follow substantive theory. Second, we introducedata source theories, a term used to describe the assumptions a researcher must make about a prospective big data source in order to meaningfully scrape data from it. Critically, researchers must derive specific hypotheses to be tested based upon their data source theory, and if these hypotheses are not empirically supported, plans to use that data source should be changed or eliminated. Third, we provide a case study and sample code in Python demonstrating how web scraping can be conducted to collect big data along with links to a web tutorial designed for psychologists. Fourth, we describe a 4-step process to be followed in web scraping projects. Fifth and finally, we discuss legal, practical and ethical concerns faced when conducting web scraping projects. (PsycINFO Database Record
authors.affiliation: Department of Psychology.
authors.forename: Richard N
authors.identifier: 0000-0001-5611-2923
authors.initials: RN
authors.lastname: Landers
authors.affiliation: ICF International.
authors.forename: Robert C
authors.initials: RC
authors.lastname: Brusso
authors.affiliation: Department of Psychology.
authors.forename: Katelyn J
authors.initials: KJ
authors.lastname: Cavanaugh
authors.affiliation: Department of Psychology.
authors.forename: Andrew B
authors.initials: AB
authors.lastname: Collmus
mesh_terms: D003628:Database Management Systems; D006801:Humans; D016247:Information Storage and Retrieval; D020407:Internet; D011584:Psychology; D012106:Research; D014584:User-Computer Interface