0

I tried to check if the websites exist but i dont get any output..

test = pd.read_csv("../input/mit-httpwww/Test URLs only (1) - Test URLs only (1).csv")

import urllib.request, urllib.error
import requests

def get_url_status(test):  # checks status for each url in list urls
    
    for test in test:
        
            with open('../input/mit-httpwww/Test URLs only (1) - Test URLs only (1).csv', newline='') as f:
                reader = csv.reader(f)
                data = list(reader)
    
            i= 0
            while i<100:
                for i in data: 
                    print(i) 
        
                    payload=test
                    r = requests.get(i, params=payload)
                    r.status_code
           
                if request.status_code == 200:
                    print(test + "\tStatus: " + str(r.status_code))
                else:
                    print(test + "\tNA FAILED TO CONNECT\t" + str(e))
                i= +1
Olvin Roght
  • 7,677
  • 2
  • 16
  • 35
  • This code only defines a function `get_utl_status` but you did not call it. So nothing would happen. – Kota Mori Oct 27 '20 at 13:02
  • ok thats right.. but now i called it and the error --> No connection adapters were found for "['http://www.AlexA-prodomo.de']" appears... – Shari E. Oct 27 '20 at 13:22
  • That looks like this issue. https://stackoverflow.com/questions/15115328/python-requests-no-connection-adapters – Kota Mori Oct 27 '20 at 13:28

0 Answers0