上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 67 下一页
摘要: 解决:更新安装service_identity 阅读全文
posted @ 2019-11-11 17:32 hank-li 阅读(257) 评论(0) 推荐(0)
摘要: 在使用python的开发过程中,常常需要判断,字符串中是否存在子串的问题, 但判断一个字符串中是否存在多个字串中的一个时,如if (a or b) in c或者if x contains a|b|c|d…, 似乎就需要借助for做循环判断,那么这种情况有没有更pythonic的方法呢? 判断一个字符 阅读全文
posted @ 2019-11-11 11:16 hank-li 阅读(9004) 评论(0) 推荐(3)
摘要: 保存数据到json文件 阅读全文
posted @ 2019-11-10 14:08 hank-li 阅读(473) 评论(0) 推荐(0)
摘要: ``` # -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals ... 阅读全文
posted @ 2019-11-10 13:58 hank-li 阅读(564) 评论(0) 推荐(0)
摘要: 一、使用cookies登录网站 二、发送post请求登录, 要手动解析网页获取登录参数 三、发送post请求登录, 自动解析网页获取登录参数 阅读全文
posted @ 2019-11-10 11:07 hank-li 阅读(1119) 评论(0) 推荐(0)
摘要: ``` # -*- coding: utf-8 -*- # Scrapy settings for maitian project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting t... 阅读全文
posted @ 2019-11-10 10:51 hank-li 阅读(370) 评论(0) 推荐(0)
摘要: 1.创建爬虫项目 2.创建爬虫文件 3.运行(crawl) 4.check检查错误 5.list返回项目所有spider 6.view 存储、打开网页 7.scrapy shell, 进入终端 8.scrapy runspider 阅读全文
posted @ 2019-11-09 09:22 hank-li 阅读(317) 评论(0) 推荐(0)
摘要: 首先创建项目: 第二步: 明确要抓取的字段 第三步: 在spider目录下创建爬虫文件: 2.1 创建一个类,并继承scrapy的一个子类: 2.2 自定义爬取名, 后面运行框架需要用到; 2.3 定义爬取目标网址 2.4 定义scrapy的方法 下面是简单项目: 第四步: 在 文件中设置数据保存到 阅读全文
posted @ 2019-11-09 00:58 hank-li 阅读(207) 评论(0) 推荐(0)
摘要: 报错内容: 解决方法: 将async替换就可以了(例如都改为shark),注意不要修改导入包的部分 阅读全文
posted @ 2019-11-07 19:07 hank-li 阅读(218) 评论(0) 推荐(0)
摘要: 1. 下载pip 地址: 注意选择tar.gz压缩包,目前最新版本为9.0.1,这里选择的版本是:pip 9.0.1.tar.gz (md5, pgp) 点击: "下载" 2. 解压安装 解压下载的压缩包至工作目录下(如D:\),打开Windows cmd,运行如下命令进入解压后的pip目录 使用如 阅读全文
posted @ 2019-11-07 10:56 hank-li 阅读(134) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 67 下一页