摘要: ``` # -*- coding: utf-8 -*- import scrapy from scrapy.http import Request,FormRequest class IqianSpider(scrapy.Spider): name = 'iqian' allowed_domains = ['edu.iqianxxx.com'] # start_urls... 阅读全文
posted @ 2018-01-24 22:05 lilied 阅读(173) 评论(0) 推荐(0) 编辑
摘要: ^ $ . ? + { } | [ ] [^] [a z] \s \S \w \W [\u4E00 \u9FA5] ( ) \d 例1 例2 简单的正则爬虫 coding: utf 8 @Author: Lai import re import os import requests BASE_PAT 阅读全文
posted @ 2018-01-20 00:58 lilied 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 注意:python2.x用mysql-python,从Python3.x起,变更为mysqlclient windows安装python的mysql驱动是so easy的: pip install mysql-python 但是毫不意外的出错了: _mysql.c(42) : fatal error 阅读全文
posted @ 2018-01-20 00:54 lilied 阅读(6278) 评论(0) 推荐(0) 编辑
摘要: 迭代器 可迭代对象:可迭代对象实现了__iter__方法,该方法返回一个迭代器对象。 迭代器: 那么什么迭代器呢?它是一个带状态的对象,他能在你调用next()方法的时候返回容器中的下一个值,任何实现了__iter__和__next__(python2中实现next())方法的对象都是迭代器,__i 阅读全文
posted @ 2018-01-19 21:25 lilied 阅读(576) 评论(0) 推荐(0) 编辑