0

Hej to all.

Need help. I need send request, if request link not correct - I need to recive false but something wrong in the code. Can someone help ?

from urllib.error import HTTPError
import requests

def form_url(urlcheck):
    try:
        y = requests.get(urlcheck)
    except HTTPError:
        return False
    if y == 200 or 403:
        return True


print(form_url("https://stackoverflow.com/"))

print(form_url("https://stackoverflowFALSE.com/")) # WRONL LINK NEED RECEVE FALSE 

0 Answers0