Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

NameError: name 'get' is not defined

I get the following error when trying to run this script python scraping from the CMD:

Microsoft Windows [Version 10]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Far\Desktop\Coding>python scraping_imdb_episodes.py
Traceback (most recent call last):
  File "C:\Users\Far\Desktop\Coding\scraping_imdb_episodes.py", line 7, in <module>
    response = get('https://www.imdb.com/title/tt1439629/episodes?season=' + str(sn))
NameError: name 'get' is not defined

I searched for the solution here and here but don’t grasp what’s going wrong.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

"get" is a method from requests library. Make sure that you have imported get from requests or else use

response = requests.get('https://www.imdb.com/title/tt1439629/episodes?season=' + str(sn))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading