title: Check if a Website Exists With Requests Isn't Working
body: <p>So, I learned how Web Scraping works a few days ago and I was messing around today. I wanted to know how I could test if a page exists/doesn't exist. So, I looked it up and I found <a href="https://stackoverflow.com/questions/16778435/python-check-if-website-exists">Python check if website exists</a>. I'm using the <code>requests</code> <code>module</code> and I got this code from the answers:</p>
  
  <pre><code>import requests
  request = requests.get('http://www.example.com')
  if request.status_code == 200:
      print('Web site exists')
  else:
      print('Web site does not exist') 
  </code></pre>
  
  <p>I tried it out, and since example.com exists, it printed "Web site exists". However, I tried something I was sure wouldn't exist, like examplewwwwwww.com and it gave me <a href="https://i.stack.imgur.com/Xt91l.png" rel="nofollow noreferrer">this error</a>. Why is it doing this and how can I keep it from printing out an error (and instead saying that the website does not exist)?</p>