@@ -0,0 +1,1562 @@
+import requests%0Aimport mechanize%0Afrom bs4 import BeautifulSoup%0A%0A# Create a browser%0Abrowser = mechanize.Browser()%0A%0A# Disable loading robot.txt%0Abrowser.set_handle_robots(False)%0A%0Abrowser.addheaders = %5B('User-agent', 'Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;)')%5D%0A%0A# movie_title = raw_input(%22Enter movie title: %22)%0Amovie_title = 'Kong: Skull Island'%0Amovie_types = ('feature', 'tv_movie', 'tv_series', 'tv_episode', 'tv_special', 'mini_series', 'documentary', 'game', 'short', 'video')%0A%0A# Navigate%0Abrowser.open('http://www.imdb.com/search/title')%0A%0A# Choose a form%0Abrowser.select_form(nr=1)%0A%0Abrowser%5B'title'%5D = movie_title%0A%0A# Check all the boxes of movie tyeps%0Afor type in movie_types:%0A    browser.find_control(type='checkbox', nr=0).get(type).selected = True%0A%0A# Submit%0Afd = browser.submit()%0Asoup = BeautifulSoup(fd.read(), 'html.parser')%0A%0A#Updated from td tag to h3 tag%0Afor div in soup.findAll('h3', %7B'class': 'lister-item-header'%7D, limit=1):%0A    a = div.findAll('a')%5B0%5D%0A    hht = 'http://www.imdb.com' + a.attrs%5B'href'%5D%0A    print(hht)%0A    page = requests.get(hht)%0A    soup2 = BeautifulSoup(page.content, 'html.parser')%0A    find = soup2.find%0A%0A    print(%22Title: %22 + find(itemprop='name').get_text().strip())%0A    print(%22Duration: %22 + find(itemprop='duration').get_text().strip())%0A    print(%22Director: %22 + find(itemprop='director').get_text().strip())%0A    print(%22Genre: %22 + find(itemprop='genre').get_text().strip())%0A    print(%22IMDB rating: %22 + find(itemprop='ratingValue').get_text().strip())%0A    print(%22Summary: %22 + find(itemprop='description').get_text().strip())

Add movie_details