![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
辰-2020
这个作者很懒,什么都没留下…
展开
-
flask定时任务之flask_apscheduler
from flask import Flaskfrom flask_apscheduler import APSchedulerapp = Flask(__name__)# scheduler 注册到 appscheduler = APScheduler() # 实例化APSchedulerscheduler.init_app(app) # 把任务列表放进flaskif __nam...原创 2019-11-05 18:25:03 · 817 阅读 · 0 评论 -
用 xpath 如何取到 title 里的文字啊
import requestsfrom lxml import etreeres = requests.get('https://s.2.taobao.com/list/list.htm?_input_charset=utf8&q=ddr3 1866&st_edtime=1').contenttxt = etree.HTML(res)# 取a标签里的title内容txt...转载 2018-11-21 11:15:48 · 12767 阅读 · 0 评论 -
Python控制台信息写入日志文件
import sysclass Logger(object): def __init__(self, filename='default.log', stream=sys.stdout): self.terminal = stream self.log = open(filename, 'a') def write(self, messag...转载 2018-11-21 16:56:16 · 4046 阅读 · 1 评论