Advertisement
naren_paste

TypeError: 'NoneType' object is not callable

Aug 16th, 2023
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | Source Code | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4. url = 'https://example.com'
  5. response = requests.get(url)
  6.  
  7. if response is not None:
  8.     soup = BeautifulSoup(response.content, 'html.parser')
  9.     # Now you can proceed with parsing and extracting data from 'soup'
  10. else:
  11.     print('Failed to fetch the webpage.')
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement