摘要: title = response.xpath('//h2[@class="margin-top-0"]/a/text()') read_num = response.xpath('//div[@class="col-md-12"]/p[@class="text-muted"]/small/text()').extract()[3].strip().replace('阅读(', '').re... 阅读全文
posted @ 2019-07-31 20:42 大智如蠢 阅读(221) 评论(0) 推荐(0) 编辑
摘要: pycharm debug调试时报错: 解决方案: 下载 anaconda 并且安装 https://www.anaconda.com/distribution/ 打开 anaconda demo 是项目的名称 说明就可以了 原因分析 : 使用pycharm调用python的时候 没找到scrapy 阅读全文
posted @ 2019-07-31 17:16 大智如蠢 阅读(10078) 评论(0) 推荐(0) 编辑
摘要: # 深度优先过程 def depth_tree(tree_node): if tree_node is not None: print(tree_node._data) if tree_node._left is not None: return depth_tree(tree_node._left) if t... 阅读全文
posted @ 2019-07-31 14:54 大智如蠢 阅读(2380) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*- import re line = "boooooooooooooobbbaaaaby123" # ^ 以这个开始 # regex_str = "^b" 以b开始 # . 任何字符 # * 多次 regex_str = "^b.*" # 正则匹配 if re.match(regex_str, line): print('yes') # $ 结... 阅读全文
posted @ 2019-07-31 14:23 大智如蠢 阅读(144) 评论(0) 推荐(0) 编辑