python2.7.13 urllib2 def add_data(self, data) 方法只能接收一个参数
2017-05-10
用pathon2.7写的,欢迎下载
http://download.csdn.net/detail/fishseeker/9836582
http://download.csdn.net/detail/fishseeker/9836582
2017-05-08
如果output.html输出乱码,可以在输出器中添加 fout.write('<meta charset="utf-8">')
2017-05-07
URL带中文、特殊字符的处理
百度了一番:
import urllib.request
from urllib.parse import quote
import string
url = "http://baike.baidu.com/item/史记·2016?fr=navbar";
url_ = quote(url, safe = string.printable);
response = urllib.request.urlopen(url_);
百度了一番:
import urllib.request
from urllib.parse import quote
import string
url = "http://baike.baidu.com/item/史记·2016?fr=navbar";
url_ = quote(url, safe = string.printable);
response = urllib.request.urlopen(url_);
2017-05-07