test01

作者: b0fbad31de2e | 来源:发表于2016-10-25 01:05 被阅读0次
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')#设置系统默认编码.

import urllib2

response = urllib2.urlopen('http://js.qq.com')
html = response.read()

print html

以及

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')#设置系统默认编码.

import urllib2

req = urllib2.Request('http://js.qq.com')
response = urllib2.urlopen(req)
the_page = response.read()

print the_page

相关文章

网友评论

      本文标题:test01

      本文链接:https://www.haomeiwen.com/subject/pzqruttx.html