Chinaunix首页 | 论坛 | 博客
  • 博客访问: 388885
  • 博文数量: 199
  • 博客积分: 154
  • 博客等级: 入伍新兵
  • 技术积分: 1530
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 08:43
文章分类

全部博文(199)

文章存档

2015年(101)

2014年(97)

2011年(1)

分类: Python/Ruby

2015-09-15 16:59:54

#!/usr/bin/env python
#encoding:UTF-8
  
import urllib.parse
import urllib.request
def get():
    url=''
    data=urllib.request.urlopen(url).read() 
    z_data=data.decode('UTF-8')
    print(z_data)
get()
阅读(1745) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

wq41132015-09-16 11:25:01

浏览器
import urllib.request
def get():
    weburl=\'http://xinsheng.huawei.com/cn/index.php?app=forum&mod=List&act=index&class=461\'
    webheader={\'User-Agent\':\'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0\'}
    req=urllib.request.Request(url=weburl,headers=webheader)
    data=urllib.request.urlopen(req).read()     
    data=data.decode(\'UTF-8\')

wq41132015-09-15 17:00:07

http://xinsheng.huawei.com/cn/index.php?app=forum&mod=List&act=index&class=461