摘要: import reimport urllib.request def getHtml(url): page = urllib.request.urlopen(url) html = page.read() return str(html)def getImg(html): r... 阅读全文
posted @ 2015-02-03 21:56 小毛驴 阅读(223) 评论(0) 推荐(0) 编辑
摘要: importurllib.requestproxy_support=urllib.request.ProxyHandler({})opener=urllib.request.build_opener(proxy_support)urllib.request.install_opener(opener... 阅读全文
posted @ 2015-02-03 14:25 小毛驴 阅读(833) 评论(0) 推荐(0) 编辑
摘要: import urllib.requestimport http.cookiejarfrom urllib.error import URLError,HTTPError import urllib.request import urllib.parse url='http://www.bai... 阅读全文
posted @ 2015-02-03 11:22 小毛驴 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 下面这个例子是我写了个文件替换的小程序。替换所有.html文件里的图片的路径import osimport ret = re.compile(r'\/?static\/|\/?media\/') #re.compiletemplate = '/home/laowangpython/'for root... 阅读全文
posted @ 2015-02-03 11:02 小毛驴 阅读(122) 评论(0) 推荐(0) 编辑