Created
October 25, 2021 23:35
-
-
Save dkav6/b3fb4a74f85e76e9b7960c571cbe4db6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scrape_urls(query, num): | |
""" | |
Takes a search query and returns links to websites of interest from google | |
""" | |
# Get urls from google search | |
urls = list(search(query, stop=num)) | |
# Trip advisor urls don't open properly so we omit them | |
urls = [url for url in urls if "tripadvisor" not in url] | |
return urls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment