Skip to content

Raise Exception: 'NoneType' object has no attribute 'get' #761

Answered by mdmintz
iqbalshekh asked this question in Q&A
Discussion options

You must be logged in to vote

@iqbalshekh
Eight things:

  1. Needs indentation
  2. Spelling of except Exception
  3. Missing : at the end of the except Exception line
  4. Missing : at the end of the if line
  5. Need to use an actual URL in the self.get() line
  6. Check for equality should be ==, not =
  7. The name/main line should be if __name__ == "__main__" :
    But most importantly:
  8. You have to run the script using pytest. (So don't use if __name__ == "__main__" :)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@iqbalshekh
Comment options

Answer selected by mdmintz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants