Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 9aa9984

Browse files
committed
updated script as per PEP8 guidelines
1 parent d62e4d3 commit 9aa9984

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed
Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<<<<<<< HEAD
21
import requests
32
from bs4 import BeautifulSoup
43

@@ -28,31 +27,3 @@
2827
print(f"Rating of {name}:", rating)
2928
except Exception:
3029
print("Try again with valid combination of tile and release year")
31-
=======
32-
import requests
33-
from bs4 import BeautifulSoup
34-
import lxml
35-
36-
#defining variables and url
37-
title= str(input("Enter the title of movie/series: ")).lower()
38-
release= str(input("Enter the year of release: ")).lower()
39-
query='+'.join(title.split())
40-
URL= f'https://www.imdb.com/search/title/?title={query}'
41-
42-
s=requests.session() #setting up session
43-
44-
try:
45-
response= s.get(URL)
46-
soup= BeautifulSoup(response.content, 'lxml')
47-
containers=soup.find_all('div', class_='lister-item-content')
48-
49-
for result in containers:
50-
name= result.h3.a.text.lower()
51-
year= result.h3.find('span', class_='lister-item-year text-muted unbold').text.lower()
52-
53-
if title in name and release in year:
54-
rating= result.find('div', class_='inline-block ratings-imdb-rating')['data-value']
55-
print(f'Rating of {title}:', rating)
56-
except:
57-
print("Try again with valid combination of tile and release year")
58-
>>>>>>> 663865b3e02855d6e855bd86f1554501fa532715

0 commit comments

Comments
 (0)