2006年12月09日 星期六 10:18
ÈçÌ⣡ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20061209/8642a893/attachment.html
2006年12月09日 星期六 12:48
最典型的socket开发了,连server的80端口,发送GET?POST请求。或者用pycurl。 -- feihu <feihu.list在gmail.com>
2006年12月09日 星期六 13:26
> > *然后一直挂机(联在某个网站上面)* > 这个可不行,http不是面向连接的协议,不知道你是不是说周期性访问? 进行http访问可以使用 urllib.urlopen('url') -- http://codeplayer.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20061209/fae221ee/attachment.html
2006年12月09日 星期六 13:28
使用PAMIE On 12/9/06, yi huang <yi.codeplayer at gmail.com> wrote: > > *然后一直挂机(联在某个网站上面)* > > > > 这个可不行,http不是面向连接的协议,不知道你是不是说周期性访问? > 进行http访问可以使用 urllib.urlopen('url') > > -- > http://codeplayer.blogspot.com/ > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20061209/574c2b6f/attachment.html
2006年12月12日 星期二 00:48
关注
2006年12月12日 星期二 11:07
python-chinese£¬ÄãºÃ Ç°Ãæ»Ø´ð¹ý£¬ÓÃPAMIEÄ£¿é¼´¿É¡£ nmweizi£¬nmweizi在163.com 2006-12-12 ----- Original Message ----- From: Î䳤±ó To: python-chinese Sent: 2006-12-12, 00:48:20 Subject: Re: [python-chinese]ÈçºÎÓÃpython±à³ÌÄ£Äâä¯ÀÀÆ÷½ø³Ì,´ò¿ªÒ»¸öÍøÒ³£¬È»ºóÒ»Ö±¹Ò»ú£¨ÁªÔÚij¸öÍøÕ¾ÉÏÃ棩£¿ ¹Ø×¢ _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20061212/cb993f8c/attachment.htm
2006年12月12日 星期二 12:35
ÔÚ06-12-12£¬nmweizi <nmweizi在163.com> дµÀ£º > > python-chinese£¬ÄãºÃ > Ç°Ãæ»Ø´ð¹ý£¬ÓÃPAMIEÄ£¿é¼´¿É¡£ > ÎÒʹÓõÄÊÇlinux¡£ Õ⼸ÌìÍæÕâ¸ö£¬Ö»Íê³ÉÒ»²¿·Ö£¨µÇ½¹¦ÄÜ£©¡£ import sys from urllib import urlencode import cookielib, urllib2 cj = cookielib.LWPCookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) urllib2.install_opener(opener) opener.addheaders = [ ("User-agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3"), ("Accept", "text/html, image/jpeg, image/png, text/*, image/*, */*")] # check args if len(sys.argv) <= 2: print "Usage: %s USERNAME PASSWORD" % (sys.argv[0]) sys.exit(1) else: UserName = sys.argv[1] Password = sys.argv[2] # login data = { 'operid': UserName, 'operpass': Password # 'firstlogin': 1, #'option': 'µÇÈëÂÛ̳' } urldata = urlencode(data) r = opener.open("http://10.140.59.175:8080/test/loginvalid.jsp", urldata) # show result results = r.read() print results open('main.jsp', 'w').write(results) # save cookies to file cj.save("./cookies") µ½Õâ¸öµØ·½£¬´Óprint results´ò³öµÄ½á¹ûÈçÏ£¬£¨ÕâÀï¿ÉÒÔ˵Ã÷µÇ½ͨ¹ýÁË£¡£©µÇ¼ ¶ø±£´æµÄcookieÎļþΪ£º #LWP-Cookies-2.0 ¾ÍÕâôµã£¬ÓеãÆæ¹Ö£¡ ÏÂÒ»²½£¬¾ÍÊÇÒª¹Òµ½main.jspÉÏÈ¥ÁË¡£µ«ÈçºÎ×öÄØ£¿ÄÄλ°ïæ¼ÌÐøһϣ¬»òÊÇÖ¸µãÒ»ÏÂÃÔ½ò£¡ лл£¡ nmweizi£¬nmweizi在163.com<%3C%21--AID_FROMADDRESS_BEGIN--%3Enmweizi在163.com%3C%21--AID_FROMADDRESS_END--%3E> > 2006-12-12 > > ----- Original Message ----- > *From: *Î䳤±ó <chbin.w在gmail.com> > *To: *python-chinese <python-chinese在lists.python.cn> > *Sent: *2006-12-12, 00:48:20 > *Subject: *Re: [python-chinese]ÈçºÎÓÃpython±à³ÌÄ£Äâä¯ÀÀÆ÷½ø³Ì,´ò¿ªÒ»¸öÍøÒ³£¬È»ºóÒ»Ö±¹Ò»ú£¨ÁªÔÚij¸öÍøÕ¾ÉÏÃ棩£¿ > > ¹Ø×¢ > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn<+python-chinese在lists.python.cn> > Subscribe: send subscribe to python-chinese-request在lists.python.cn<+python-chinese-request在lists.python.cn> > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn<+python-chinese-request在lists.python.cn> > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20061212/9a37b872/attachment.htm
Zeuux © 2025
京ICP备05028076号