摘要:
import reimport urllib.request def getHtml(url): page = urllib.request.urlopen(url) html = page.read() return str(html)def getImg(html): r... 阅读全文
摘要:
importurllib.requestproxy_support=urllib.request.ProxyHandler({})opener=urllib.request.build_opener(proxy_support)urllib.request.install_opener(opener... 阅读全文
摘要:
import urllib.requestimport http.cookiejarfrom urllib.error import URLError,HTTPError import urllib.request import urllib.parse url='http://www.bai... 阅读全文
摘要:
下面这个例子是我写了个文件替换的小程序。替换所有.html文件里的图片的路径import osimport ret = re.compile(r'\/?static\/|\/?media\/') #re.compiletemplate = '/home/laowangpython/'for root... 阅读全文