摘要: 常用的SQLAlchemy查询过滤器 常用的SQLAlchemy查询执行器 阅读全文
posted @ 2019-05-21 13:02 Mr_Smith 阅读(2322) 评论(0) 推荐(0)
摘要: json 序列与反序列化 js中处理json 阅读全文
posted @ 2019-05-20 10:25 Mr_Smith 阅读(532) 评论(0) 推荐(0)
摘要: @passport_blu.route('/image_code') def get_image_code(): """ 生成图片验证码并返回 1. 取到参数 2. 判断参数是否有值 3. 生成图片验证码 4. 保存图片验证码文字内容到redis 5. 返回验证码图片 :return: """ # 1. 取到参数 ... 阅读全文
posted @ 2019-05-20 00:16 Mr_Smith 阅读(480) 评论(0) 推荐(0)
摘要: function generateUUID() { var d = new Date().getTime(); if(window.performance && typeof window.performance.now "function"){ d += performance.now(); // 阅读全文
posted @ 2019-05-19 23:23 Mr_Smith 阅读(1887) 评论(0) 推荐(0)
摘要: import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from redis import Redis from incrementPro.items import IncrementproItem class MovieSpider(C... 阅读全文
posted @ 2019-05-17 22:52 Mr_Smith 阅读(190) 评论(0) 推荐(0)
摘要: pip install scrapy-redisscrapy genspider -t crawl xxx www.xxx.com class ChoutiSpider(RedisCrawlSpider): name = 'chouti' # allowed_domains = ['www.chouti.com'] # start_urls = ['http://www.ch... 阅读全文
posted @ 2019-05-16 21:36 Mr_Smith 阅读(146) 评论(0) 推荐(0)
摘要: 1.创建scrapy工程:scrapy startproject projectName 2.创建爬虫文件:scrapy genspider -t crawl spiderName www.xxx.com # -*- coding: utf-8 -*- import scrapy from scra 阅读全文
posted @ 2019-05-16 13:11 Mr_Smith 阅读(610) 评论(0) 推荐(0)
摘要: class MovieSpider(scrapy.Spider): name = 'movie' allowed_domains = ['www.id97.com'] start_urls = ['http://www.id97.com/'] def parse(self, response): div_list = response.xpath... 阅读全文
posted @ 2019-05-16 11:24 Mr_Smith 阅读(866) 评论(0) 推荐(0)
摘要: 增加并发: 默认scrapy开启的并发线程为32个,可以适当进行增加。在settings配置文件中修改CONCURRENT_REQUESTS = 100值为100,并发设置成了为100。 降低日志级别: 在运行scrapy时,会有大量日志信息的输出,为了减少CPU的使用率。可以设置log输出信息为INFO或者ERROR即可。在配置文件中编写:LOG_LEVEL = ‘INFO’... 阅读全文
posted @ 2019-05-16 11:18 Mr_Smith 阅读(171) 评论(0) 推荐(0)
摘要: #创建项目 scrapy startproject demo #开一个爬虫项目 cd demo scrapy genspider first www.baidu.com #setting 中设置 ROBOTSTXT_OBEY = False USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/... 阅读全文
posted @ 2019-05-14 16:10 Mr_Smith 阅读(149) 评论(0) 推荐(0)