1.基本方法 urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capath=None, cadefault=False, context=None) url: 需要爬取的网址 data: Post提交数据 timeo ...
分类:
编程语言 时间:
2017-09-16 16:14:24
阅读次数:
271
1、短信接口文档: URL http://xxx.com/interfaces/sendMsg.htm Method POST Description 文字短信调用接口 Request Param List Response Param List 2、自定义端口post方式以及python脚本: 3 ...
分类:
移动开发 时间:
2017-09-14 21:52:32
阅读次数:
227
from bs4 import BeautifulSoup import urllib.request as request import os import time import threading url_s = 'http://bbs.tianya.cn/m/post-develop-' u... ...
分类:
其他好文 时间:
2017-09-14 18:50:31
阅读次数:
295
Python如何访问互联网 URL + lib --> urllib URL的一般格式为 protocol://hostname[:port]/path/[;parameters][?query]#fragment URL由三部分组成 第一部分是协议:http,https,ftp,file,ed2k ...
分类:
编程语言 时间:
2017-09-14 18:48:50
阅读次数:
194
1.urlparse() 属于urllib.parse 在urlparse世界里面,一个标准的URL链接格式如下 scheme://nrtlooc/path;paramters?query#fragment 所以,一个url='http://www.baidu.com/index.html;user ...
分类:
编程语言 时间:
2017-09-14 18:44:42
阅读次数:
184
用python写web,其实我不明白,为什么相对后端语言来说,python写web比较麻烦,但是还是有人喜欢用....(我感觉像是自虐) ...
分类:
Web程序 时间:
2017-09-12 11:09:29
阅读次数:
303
Python readability的使用: from readability.readability import Document import urllib html = urllib.urlopen(url).read() readable_article = Document(html). ...
分类:
编程语言 时间:
2017-09-11 10:14:27
阅读次数:
263
import reimport urllib.request# ------ 获取网页源代码的方法 ---def getHtml(url): page = urllib.request.urlopen(url) html = page.read() return html# ------ getHt... ...
分类:
Web程序 时间:
2017-09-11 10:08:23
阅读次数:
262
概述 urllib是python最基础、最核心的HTTP协议支持库,诸多第三方库都依赖urllib,所以urllib是必须掌握的HTTP库。 掌握了urllib有利于: 深入理解http协议 可以更好的学习和掌握第三方http库 快速的开展基于http的接口测试 快速进入爬虫学习之路 urllib组 ...
分类:
编程语言 时间:
2017-09-10 10:04:39
阅读次数:
204
# 爬虫项目原理:打开网址 获取源码 找到图片 匹配取出## urllib模块:urlopen打开 read源码# urlretrieve保存到文件,下载 ...
分类:
Web程序 时间:
2017-09-09 15:50:54
阅读次数:
189