diff --git a/.gitignore b/.gitignore index 62c8935..0b71a72 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea/ \ No newline at end of file +.idea/ +spider/jianshu/start.sh \ No newline at end of file diff --git a/README.md b/README.md index 260341a..8e4a3df 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,13 @@ ## Introduction -- `auto`: 自动化&&抓包,如selenium、appium、mitmproxy -- `basic`: python基础练习 +- `auto`: 自动化 && 抓包 Demo, selenium、appium、mitmproxy +- `basic`: python基础 Demo - `blogs`: 基于web.py的简书数据统计 -- `datascience`: 数据科学,如numpy、pandas、matplotlib -- `mydjango`: Django练习 -- `myflask`: Flask练习 -- `orm`: sqlalchemy和peewee示例 -- `scrapys`: scrapy项目 -- `single`: 某小程序爬虫&&机器人 -- `spider`: 爬虫项目 -- `tsflow`: TensorFlow练习 -- `utils`: 工具包 -- `wechat`: 微信机器人&&公众号爬取 \ No newline at end of file +- `datascience`: 数据科学,numpy、pandas、matplotlib +- `mydjango`: Django Demo +- `orm`: sqlalchemy && peewee Demo +- `scrapys`: scrapy examples +- `single`: 某小程序爬虫 && 机器人 +- `spider`: 简单爬虫examples +- `utils`: 小小工具包 +- `wechat`: 微信机器人 && 公众号抓取 \ No newline at end of file diff --git a/auto/qmm.py b/auto/qmm.py index 2d37f43..7591ca2 100644 --- a/auto/qmm.py +++ b/auto/qmm.py @@ -39,7 +39,7 @@ def _crawl_url(self): for link in bs.tbody.find_all('a'): text = link.text if self.months: - if not list(filter(lambda m: m in text, self.months)): continue + if not list(filter(lambda m: m in text[0:len(m)], self.months)): continue if self.days: if not list(filter(lambda d: d in text, self.days)): continue @@ -172,5 +172,5 @@ def _finance_sign(self, driver): if __name__ == '__main__': - qmm = QMM(sleep=3, months='12', days='5-31') + qmm = QMM(sleep=3, months='4', days='1-30') qmm.start() diff --git a/blogs/read.py b/blogs/read.py index 7d9b598..1df643a 100644 --- a/blogs/read.py +++ b/blogs/read.py @@ -1,5 +1,6 @@ -import math import time + +import math import numpy import requests from bs4 import BeautifulSoup @@ -54,7 +55,7 @@ def count(self): bs = BeautifulSoup(resp.text, 'html.parser') avatar = bs.find(class_='avatar') # 头像 - self.avatar = 'https:' + avatar.img['src'] + self.avatar = avatar.img['src'] nickname = bs.find(class_='name') # 昵称 self.nickname = nickname.text diff --git a/blogs/templates/show.html b/blogs/templates/show.html index 4f5b57c..5f7d89d 100644 --- a/blogs/templates/show.html +++ b/blogs/templates/show.html @@ -6,18 +6,19 @@ -