Skip to content

Instantly share code, notes, and snippets.

@dkav6
Created October 25, 2021 23:35
Show Gist options
  • Save dkav6/b3fb4a74f85e76e9b7960c571cbe4db6 to your computer and use it in GitHub Desktop.
Save dkav6/b3fb4a74f85e76e9b7960c571cbe4db6 to your computer and use it in GitHub Desktop.
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