What specific things need to check for URL using Python?

时间:2016-04-04 18:29:32

标签: python python-2.7 url urllib2

I have few urls for that I want to check status so that I can keep track of its health. I figured out and coded for below using Python :

1)Status Code
2)Response Time

Please suggest if anything more need to be add to check .

URL's having both https and http. also Have www.abc.com , www.abc.com/xyz/login.do and similar type of pattern.

I am new to this so not much aware what to check other that status code and response time.

Note: Timeout and few more error I have taken care of those.

There is no dependency . Mostly are application URLs hosted from application server .

1 个答案:

答案 0 :(得分:0)

In addition to them, I recommend you to consider the case when the connection to the urls fails (maybe your program would raise an error). For example, lost of the Internet connection or out of DNS service can cause such a case.

If you're going to check some APIs, seeing Response Body would also be helpful.