ccdrea's recent timeline updates
ccdrea

ccdrea

V2EX member #248402, joined on 2017-08-13 16:21:33 +08:00
ccdrea's recent replies
Apr 30, 2019
Replied to a topic by old18 Python selenium 点击的问题.请各位大佬指教一下.
self.broswer.execute_script("arguments[0].click();",checkbox )
>>> a = 1
>>> id(a)
1598830848
>>> b = [a]
>>> id(b)
9390640
>>> id(b[0])
1598830848
>>>
看懂了吗
Apr 30, 2019
Replied to a topic by daiqiangbudainiu Python 求教怎么能比较优雅的实现这个功能
补充:
from collections import OrderedDict

c = list(map(lambda x:OrderedDict(x),a))[-1]

# OrderedDict 实现一个 FIFO 得 dict
Apr 30, 2019
Replied to a topic by daiqiangbudainiu Python 求教怎么能比较优雅的实现这个功能
1.
max(data, key=lambda x: int(x['label'].replace('p','')))

2.
data.sort(key=lambda x:int(x['label'].replace('p','')))
data[-1]
Apr 26, 2019
Replied to a topic by daiqiangbudainiu Python Scrapy 怎么能主动关闭呢?
去看官方文档,Extensions 这部分。https://scrapy-chs.readthedocs.io/zh_CN/0.24/topics/extensions.html
简单来说,setting 设置接收数据的信号收发标记,一段时间数据为空,自动关闭 scrapy
time sleep 是同步阻塞,pypp 是异步。
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2976 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 08:58 · PVG 16:58 · LAX 01:58 · JFK 04:58
♥ Do have faith in what you're doing.