URI http get

U

usgog

I have a website and by accessing it from the browser, for example:
"http://www.xxxx.com:1111/status", the web page will display "ok" only
if the URI is up. And it will return "website could not be found" alert
if the URI is down.

In Python, is there a way to retrieve "ok" programmatically and detect
alert if the URI is down?
 
J

jepler

The "urllib2" module is designed for tasks like this. The tutorial
shows how to use urllib2.urlopen() to fetch the contents of a URL
using the http protocol.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDj7AkJd01MZaTXX0RAnTrAJ99gl7R3+yo2Hvu49eVZkE5KMytOQCdEM1i
DskAhKxFButIHqQaLu4024E=
=j4HX
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,272
Messages
2,571,362
Members
48,045
Latest member
Damian56J

Latest Threads

Top