jeudi 30 janvier 2020

Checking if the website is reachable with or without www

How to check if the website is reachable with or without www. For example the following URL:

https://corteva.in/

is unreachable. But when entered like (with www):

https://www.corteva.in/

it correctly displays in the browser. Is there a way I could check this with python?

I tried the following:

import socket
socket.gethostbyname('www.corteva.in')
socket.gethostbyname('corteva.in')

both resolve to some IP address. But when loading in the browser like https://corteva.in the browser is never able to load the web service.




Aucun commentaire:

Enregistrer un commentaire