公司网站首页遇到的问题
2015-10-07 20:50
666 查看
urllib参考:
http://www.cnblogs.com/sysu-blackbear/p/3629420.html
urlopen返回对象提供方法:
- read() , readline() ,readlines() , fileno() , close() :这些方法的使用方式与文件对象完全一样
- info():返回一个httplib.HTTPMessage对象,表示远程服务器返回的头信息
- getcode():返回Http状态码。如果是http请求,200请求成功完成;404网址未找到
- geturl():返回请求的url
http://www.cnblogs.com/sysu-blackbear/p/3629420.html
1.urllib.urlopen(url[,data[,proxies]])
打开一个url的方法,返回一个文件对象,然后可以进行类似文件对象的操作。本例试着打开google>>> import urllib >>> f = urllib.urlopen('http://www.google.com.hk/') >>> firstLine = f.readline() #读取html页面的第一行 >>> firstLine '<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage"><head><meta content="/images/google_favicon_128.png" itemprop="image"><title>Google</title><script>(function(){\n'
urlopen返回对象提供方法:
- read() , readline() ,readlines() , fileno() , close() :这些方法的使用方式与文件对象完全一样
- info():返回一个httplib.HTTPMessage对象,表示远程服务器返回的头信息
- getcode():返回Http状态码。如果是http请求,200请求成功完成;404网址未找到
- geturl():返回请求的url
相关文章推荐
- 通过读取淘宝API的优化 来考虑高并发网站的架构讨论
- 淘宝网采用什么技术架构来实现网站高负载的
- C# 通过WebService方式 IIS发布网站 上传文件到服务器
- 大型网站之分布式会话管理
- 大型高并发网站首选LAMP架构
- iOS开发-------MVC架构思想-植物大战僵尸
- 我的常用网站整理
- Storm系列(十二)架构分析之Worker-心跳信息处理
- 大型网站之分布式会话管理
- 求助!求助!网站页面图片太多,加载时间太长该怎么办?
- Android平台架构及特性
- 【Machine Learning in Action --4】朴素贝叶斯过滤网站的恶意留言
- 网站运维常用小技巧,排错必备
- iOS开发常用国外网站清单
- 架构师内练基础
- 网站关键词优化--长尾关键6词的优化方法
- 网站地图
- HA集群配置
- 网站典型故障案例
- 飞鸽传飞官方网站