Difference between revisions of "Google Crawler"
LasyaRajan (talk | contribs) |
AnneFreeman (talk | contribs) |
||
Line 1: | Line 1: | ||
{{McNair Projects | {{McNair Projects | ||
− | |Has title= | + | |Has title=Web Crawler |
|Has owner=Anne Freeman, | |Has owner=Anne Freeman, | ||
|Has project status=Active | |Has project status=Active | ||
Line 6: | Line 6: | ||
}} | }} | ||
==Background== | ==Background== | ||
− | We wanted to create a | + | We wanted to create a web crawler that could collect data from google searches specific to individual cities. The searches could be in the format of "incubator" + "city, state". It was modeled off of previous researcher's web crawler which collected information on accelerators. We could not simply modify their web crawler as it used an outdated python module. |
The output from this crawler could be used in several ways: | The output from this crawler could be used in several ways: | ||
Line 14: | Line 14: | ||
# The page can be passed over to Amazon's [https://www.mturk.com/ Mechanical Turk] to outsource the task of classifying pages as being incubators. | # The page can be passed over to Amazon's [https://www.mturk.com/ Mechanical Turk] to outsource the task of classifying pages as being incubators. | ||
+ | ==Selenium Implementation== | ||
+ | The selenium implementation of the crawler requires a downloaded chrome driver. The crawler opens the text file containing a list of locations in the format "city, state" with each entry separated by a newline. It appends the google search query domain "https://www.google.com/search?q=" to the front of the key term "incubator" and appropriately attaches the city and state name, using google escape characters for commas and spaces. Then the crawler uses the chromedriver browser to access the url and parse the results for each location. It's default is to parse 10 pages of results, meaning that approximately 100 lines of data are collected for each location. | ||
+ | Relevant files, including python script, text files are located in | ||
+ | E:\projects\Kauffman Incubator Project\01 Classify entrepreneurship ecosystem organizations\SeleniumCrawler | ||
− | ==Implementation== | + | ==Beautiful Soup Implementation== |
− | The crawler | + | When we created the web crawler, our first implementation used beautiful soup to directly "request" the url. The crawler took the same input file (city, state on each line, separated by newlines) and formatted queries in the same manner. Then, using beautifulsoup, the script opens each of the generated urls and parses the resulting page to collect the titles and urls of the results. The data collected is stored in a tab separated text file with each row containing city, state, title of result, url |
− | The | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Relevant files, including python script, text | + | Relevant files, including python script, text files are located in |
− | E:\projects\Kauffman Incubator Project\01 Classify entrepreneurship ecosystem organizations\GoogleCrawler | + | E:\projects\Kauffman Incubator Project\01 Classify entrepreneurship ecosystem organizations\GoogleCrawler |
+ | |||
+ | This crawler was frequently blocked, as directly performed queries to google and parsed the results with beautiful soup. Additionally, this implementation would only collect eight results for each location. To prevent the crawler from being blocked and collect more results, we decided to switch and use selenium. |
Revision as of 13:12, 15 April 2019
Google Crawler | |
---|---|
Project Information | |
Project Title | Web Crawler |
Owner | Anne Freeman |
Start Date | |
Deadline | |
Primary Billing | |
Notes | |
Has project status | Active |
Copyright © 2016 edegan.com. All Rights Reserved. |
Background
We wanted to create a web crawler that could collect data from google searches specific to individual cities. The searches could be in the format of "incubator" + "city, state". It was modeled off of previous researcher's web crawler which collected information on accelerators. We could not simply modify their web crawler as it used an outdated python module.
The output from this crawler could be used in several ways:
- The URLs determined to be incubator websites can be input for the Listing Page Classifier that takes an incubator website URL and identifies which page contains the client company listing.
- The title text can be analyzed using n-grams to look for keywords in order to classify the URL as an incubator. This strategy is discussed in Geocoding Inventor Locations (Tool).
- Key elements of a page's HTML can be feed into an adapted version of the Demo Day Page Google Classifier to identify demo day webpages that contain a list of cohort companies.
- The page can be passed over to Amazon's Mechanical Turk to outsource the task of classifying pages as being incubators.
Selenium Implementation
The selenium implementation of the crawler requires a downloaded chrome driver. The crawler opens the text file containing a list of locations in the format "city, state" with each entry separated by a newline. It appends the google search query domain "https://www.google.com/search?q=" to the front of the key term "incubator" and appropriately attaches the city and state name, using google escape characters for commas and spaces. Then the crawler uses the chromedriver browser to access the url and parse the results for each location. It's default is to parse 10 pages of results, meaning that approximately 100 lines of data are collected for each location.
Relevant files, including python script, text files are located in
E:\projects\Kauffman Incubator Project\01 Classify entrepreneurship ecosystem organizations\SeleniumCrawler
Beautiful Soup Implementation
When we created the web crawler, our first implementation used beautiful soup to directly "request" the url. The crawler took the same input file (city, state on each line, separated by newlines) and formatted queries in the same manner. Then, using beautifulsoup, the script opens each of the generated urls and parses the resulting page to collect the titles and urls of the results. The data collected is stored in a tab separated text file with each row containing city, state, title of result, url
Relevant files, including python script, text files are located in
E:\projects\Kauffman Incubator Project\01 Classify entrepreneurship ecosystem organizations\GoogleCrawler
This crawler was frequently blocked, as directly performed queries to google and parsed the results with beautiful soup. Additionally, this implementation would only collect eight results for each location. To prevent the crawler from being blocked and collect more results, we decided to switch and use selenium.