Skip to content

Instantly share code, notes, and snippets.

@zakirangwala
Last active September 23, 2020 14:18
Show Gist options
  • Save zakirangwala/6a6d388501fa26bc89e6ba05958aa379 to your computer and use it in GitHub Desktop.
Save zakirangwala/6a6d388501fa26bc89e6ba05958aa379 to your computer and use it in GitHub Desktop.
Tutorial Code : Scrape web for IMDB movie link
import imdb
# Find IMDB
def find_imdb(query):
try:
query += ' IMDB'
URL = google_query(query)[0]
page = requests.get(URL, headers=headers)
html_content = page.text
soup = BeautifulSoup(html_content, 'lxml')
title = soup.title.string
title = title[0:-7]
return title
except Exception as e:
print('Movie could not be found')
speak('Movie could not be found')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment