python实现更新页面内容的小例子,已经修改成“更新订饭菜单“

客为尊订饭:http://www.kwzcy.com/Product_List.asp?action=GetAddress&Address1=%C9%CF%B5%D8%C8%ED%BC%FE%D4%B0&Address2=%C9%CF%B5%D8%C8%ED%BC%FE%D4%B0%B9%FA%D3%C2%B4%F3%CF%C3&Address3=&A_CompanyName=

 

 

 

import struct
import urllib
import re

webmutong=urllib.urlopen("http://www.baidu.com/")
str=webmutong.read()
#print str

str = unicode(str,"gb2312")
lstChinese = re.findall(ur'[/u2e80-/uffff]', str)
#print lstChinese

sChinese = u""
for c in lstChinese :
 sChinese += c
#print sChinese

f = open("meun.txt",'wb')
f.write(sChinese.encode("gbk"))
f.close()

你可能感兴趣的:(c,python,import)