2004年08月25日 星期三 10:23
Hollo dreamingk(天成):
在下是:
shRequest.add_header("Accept-Language","zh-cn")
shRequest.add_header("Content-Type","text/html; charset=gb2312")
shRequest.add_header("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)")
应该说可以有方法查看本地浏览器自动送出的头的,
原先 是使用同事JAVA 作的一个web server 打印出来的,
Python 应该有同样的功能模块,
好的站点服务脚本,根据 HTTP 请求的head 进行相应处理,是必须提供的!
"天气预报网络自动抓取工具 "
http://www.czug.org/Members/ZqStudio/zproj/getSH%20Weahther/idx_getSHwunderground/document_view
的写作过程中,就发现,如果仅仅发送请求,将得到 iso编码的页面,而不是IE看到的中文页面………………
/******** [2004-08-25]10:18:37 ; dreamingk(天成) wrote:
dreamingk(天成)> dreamingk(天成),您好!
dreamingk(天成)> opener.addheaders = [
dreamingk(天成)> ("User-agent", "Mozilla/5.0
dreamingk(天成)> (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107
dreamingk(天成)> Debian/1.5-3"),
dreamingk(天成)> ("Accept", "text/html,
dreamingk(天成)> image/jpeg, image/png, text/*, image/*, */*")]
dreamingk(天成)> 我用的winxp ie6
dreamingk(天成)> 这一段应该怎么写?这个header必须要写吗?
dreamingk(天成)> ======= 2004-08-25 10:11:08 您在来信中写道:=======
>>Xie Yanbo,您好!
>> cookie=ClientCookie.CookieJar()
>> cookie.save(... )
>> AttributeError: CookieJar instance has no attribute 'save'
>>
>>======= 2004-08-25 10:01:58 您在来信中写道:=======
>>
>>>On 2004-08-25 09:57:1093399068 +0800, dreamingk(天成) wrote:
>>>> Xie Yanbo,您好!
>>>>
>>>> hehe 我正想呢,我看了半天lib
>>>> ref,从来没见到过ClientCookie呢。。。
>>>
>>>建议现在就开始学习 cookielib, 毕竟 python2.4 正式版已经近在咫尺了
>>>
>>> http://www.python.org/dev/doc/devel/whatsnew/whatsnew24.html
>>>
>>>再过几天你就可以在正式版的 lib reference 里面看到它了。
>>>
>>>_______________________________________________
>>>python-chinese list
>>>python-chinese at lists.python.cn
>>>http://python.cn/mailman/listinfo/python-chinese
>>>
>>
>>= = = = = = = = = = = = = = = = = = = =
>>
>>
>> 致
>>礼!
>>
>>
>> dreamingk(天成)
>> dreamingker at 163.com
>> 2004-08-25
>>
>>_______________________________________________
>>python-chinese list
>>python-chinese at lists.python.cn
>>http://python.cn/mailman/listinfo/python-chinese
>>
dreamingk(天成)> = = = = = = = = = = = = = = = = = = = =
dreamingk(天成)> 致
dreamingk(天成)> 礼!
dreamingk(天成)> dreamingk(天成)
dreamingk(天成)> dreamingker at 163.com
dreamingk(天成)> 2004-08-25
********************************************/
--
Free as in Freedom
Zoom.Quiet
#=========================================#
]Time is unimportant, only life important![
#=========================================#
sender is the Bat!2.12.00
Zeuux © 2025
京ICP备05028076号