爬虫
ding1991as
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
request post 模拟登录 csdn 获取保存cookie
# -*- coding=utf-8 -*-import requestsfrom lxml import etreeheaders = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.原创 2017-06-29 18:11:57 · 1014 阅读 · 0 评论 -
模拟登录知乎
# !/usr/bin/env python3# -*- coding: utf-8 -*-'''Required- requests (必须)- pillow (可选)Info- author : "xchaoinfo"- email : "xchaoinfo@qq.com"- date : "2016.2.4"Update- name : "wangmengcn转载 2017-06-30 15:11:29 · 532 阅读 · 0 评论 -
request session
# -*- coding:utf8 -*-import requestsfrom lxml import etreeheaders = { # 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', # 'Accept-Encoding原创 2017-06-30 20:18:21 · 340 阅读 · 0 评论 -
requests session获取当前cookie cookie对象转字典 字典转对象
session 获取cookies=session运行get请求s.cookies 即是cookie对象#实例化一个LWPCookieJar对象load_cookiejar = cookielib.LWPCookieJar()#从文件中加载cookies(LWP格式)load_cookiejar.load('cookies/' + self.username转载 2017-07-13 17:56:54 · 1901 阅读 · 0 评论 -
爬虫 xpath 的使用与范例
#coding:utf-8from flask import Flaskimport requestsfrom lxml import etreeapp= Flask(__name__)app.debug =True#爬取小说并返回到前台@app.route('/',methods=['GET','POST'])def index(): r = requests.get原创 2017-06-14 16:38:19 · 490 阅读 · 0 评论 -
asyncio 异步爬虫
基于Python3.5 的asyncio 的 异步爬虫案例:我们会实现以下功能: 1: 单进程 实现并发 异步爬虫 2: 解决并发过多报错 too many file descriptors in select 3: 实现异步 master-worker 主从模式以下是具体代码实现:1: #coding:utf-8import time,asyncio,aiohttp...原创 2018-03-06 00:12:13 · 4302 阅读 · 2 评论
分享