Basically, all it does is to open a list of URLs and then use requests to submit that URL. It then gets the response back. If I get a 404, which means the file is not there, then it puts that URL in a list and moves on.
Once the script is finished it puts the list of bad URLs into a file so the bad links can be shared with the client.
I'm not sure if anyone else will find this useful, but I've used it several times lately and wanted to share it.
The code is as follows:
flaturl = 
urllist = pandas.read_csv('urls.csv')
urllist2 = urllist.values.tolist()
for sublist in urllist2:
for item in sublist:
flaturl.sort(reverse = True)
brokenlist = 
for l in flaturl:
r = requests.get(l)
c = r.status_code
print(l, ' ', c)
if c != 200:
df = pandas.DataFrame(brokenlist)
Let me know if you find this useful.