Compruebe si existe URL Python
import requests
def isvalid(url):
return requests.head(url).status_code < 400
Dull Dugong
import requests
def isvalid(url):
return requests.head(url).status_code < 400
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')