目錄html
Requests: 最友好的網絡爬蟲功能庫,http://www.python-requests.org/python
import requests r = requests.get('https://api.github.com/user', auth=('user', 'pass')) r.status_code r.headers['content-type'] r.encoding r.text
Scrapy: 優秀的網絡爬蟲框架,Python數據分析高層次應用庫,https://scrapy.orggit
pyspider: 強大的Web頁面爬取系統,http://docs.pyspider.orggithub
Beautiful Soup: HTML和XML的解析庫,https://www.crummy.com/software/BeautifulSoup/bs4web
Re: 正則表達式解析和處理功能庫,https://docs.python.org/3.6/library/re.html正則表達式
Python-Goose: 提取文章類型Web頁面的功能庫,https://github.com/grangier/python-goose數據庫
from goose import Goose url = 'http://www.elmundo.es/elmundo/2012/10/28/espana/1351388909.html' g = Goose({'use_meta_language': False,'target_language':'es'}) article = g.extract(url=url) article.cleaned_text[:150]
Django: 最流行的Web應用框架,https://www.djangoproject.comdjango
Pyramid: 規模適中的Web應用框架,https://trypyramid.com/flask
# 10行左右Hello Word程序 from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid.response import Response def hello_world(request): return Response('Hello World') if __name__ == '__main__': with Configurator() as config: config.add_route('hello', '/') config.add_view(hello_world, route_name='hello') app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) server.serve_forever()
Flask: Web應用開發微框架,http://flask.pocoo.org後端
from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!'
WeRoBot: 微信公衆號開發框架,https://github.com/offu/WeRoBot
# 對微信每一個消息反饋一個Hello World import werobot robot = werobot.WeRoBot(token='tokenhere') @robot.handler def hello(message): return 'Hello World!'
aip: 百度AI開放平臺接口,https://github.com/offu/WeRoBot
MyQR: 二維碼生成第三方庫,https://github.com/sylnsfar/qrcode