python - using requests to check dead URLs -


i using requests library check number of urls. aim see if still alive or not. code simple

import requests  def checkurlalive(url):     r = requests.head(url,timeout=10)     if r.ok:         return true     else:          return false 

however, not work following url:

http://ieeexplore.ieee.org/ielx5/6294/4804034/04804053.pdftp=&arnumber=4804053&isnumber=4804034

this url works on computer shows pdf file, however, method above gives me requests.exceptions.timeout error.

on other hand, following url:

http://www.wartsila.com/ss/satellite?blobcol=urldata&blobheader=jpg&blobkey=id&blobtable=mungoblobs&blobwhere=1278606917069&ssbinary=trueaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 

should not valid url method above gives me positive result.

how be?


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -