Python Forum
How to check HTTP error 500 and bypass
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check HTTP error 500 and bypass
#4
Can pass out all,and only do a check for 200.
import requests
from requests.exceptions import RequestException

url1 = "http://www.not_exist.com/"
url2 = "https://httpbin.org/status/500"
url3 = "https://httpbin.org/delay/15"
url4 = 'https://www.google.com/' # ok
try:
    response = requests.get(url4, timeout=10)
    if response.status_code == 200:
        print(response.status_code) # All ok 200
except RequestException:
    pass
Reply


Messages In This Thread
RE: How to check HTTP error 500 and bypass - by snippsat - May-04-2019, 02:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium - bypass Cloudflare bot detection klaarnou 4 16,107 Jul-29-2023, 01:42 AM
Last Post: scrapingbypass
  HTTP 404 error with Session Pool Clives 0 1,286 Jun-17-2021, 06:45 PM
Last Post: Clives
  error HTTP Error 403: Forbidden local_bit 1 2,782 Nov-14-2020, 11:34 AM
Last Post: ndc85430
  urllib.error.HTTPError: HTTP Error 404: Not Found ckkkkk 4 8,638 Mar-03-2020, 11:30 AM
Last Post: snippsat
  python beginner HTTP Error 500 leofcastro 0 2,136 Jan-24-2020, 04:37 PM
Last Post: leofcastro
  HTTP error 404 Karin 4 4,664 May-31-2019, 02:23 PM
Last Post: snippsat
  selneium JS bypass metulburr 15 6,752 Nov-05-2018, 10:52 AM
Last Post: Larz60+
  Syntax error for HTTP request GET THX1138 1 6,345 May-12-2018, 12:02 PM
Last Post: snippsat
  selenium bypass javascript popup box metulburr 6 8,309 Jun-02-2017, 07:15 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020