Re: [Tutor] Passing HTTP commands through Telnet using Python for web site testing?

2005-11-17 Thread Kent Johnson
Adisegna wrote: > So far this is what I have come up with doing some research. > > import urllib > for line in urllib.urlopen('http://mywebsit.com/folder/folder/test.asp'): > if '400 Bad Request' in line: > > text_file = open("mysite.log", "a") > text_file.writelines(line) > text_file.w

Re: [Tutor] Passing HTTP commands through Telnet using Python for web site testing?

2005-11-17 Thread Kent Johnson
Adisegna wrote: > Hi, > > I just started learning Python and would like to try writing a > monitoring script. > > What I would like to do is use Telnet to send a GET via port 80 to a > status page in a directory to verify my site is up. I use httplib for this. You can probably do it with urlli

Re: [Tutor] Passing HTTP commands through Telnet using Python for web site testing?

2005-11-16 Thread Adisegna
So far this is what I have come up with doing some research. import urllib for line in urllib.urlopen('http://mywebsit.com/folder/folder/test.asp'):  if '400 Bad Request' in line:      text_file = open("mysite.log", "a") text_file.writelines(line) text_file.writelines("\n") text_file.close()

[Tutor] Passing HTTP commands through Telnet using Python for web site testing?

2005-11-16 Thread Adisegna
Hi, I just started learning Python and would like to try writing a monitoring script. What I would like to do is use Telnet to send a GET via port 80 to a status page in a directory to verify my site is up. Psuedo code: Connect = telnet website.com 80 Send = GET /folder/folder/test.asp HTTP/1.