-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrew.py
30 lines (24 loc) · 912 Bytes
/
rew.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# import requests
# from requests.exceptions import HTTPError
# try:
# responce = requests.get('https://api.github.com/search/repositories', params={'q': 'requests+language:cpp'})
# responce.raise_for_status()
# print('успешное подключение')
# json_r = responce.json()
# for repo in json_r['items']:
# print(repo['description'])
# except HTTPError as http_e:
# print(f'HTTP error occurred')
# except Exception as err:
# print(f'other error occurred')
import requests
url = "https://imdb8.p.rapidapi.com/title/find"
querystring = {"q":"squid game"}
headers = {
'x-rapidapi-host': "imdb8.p.rapidapi.com",
'x-rapidapi-key': "86e4e079cemshba17a82d5ffe9afp16ac0bjsnab4c30b8c551"
}
response = requests.request("GET", url, headers=headers, params=querystring)
json_responce = response.json()
for line in json_responce['results']:
print(line)