0

I'm looking for the fastest method to retrieve whether or not an URL exists. I'd like to do the test on a list of URLs.

Thanks for your help

Martin
  • 9

1 Answers1

1
import httplib
c = httplib.HTTPConnection('www.stackoverflow.com')
c.request("HEAD", '')
if c.getresponse().status == 301:
   print('Good news. Website is valid')
seralouk
  • 30,938
  • 9
  • 118
  • 133