帮助
https://workflowy.com/s/CbqM.M3tcZFhqd3#/?q=ADM-NF01
我想抓住
功能路线图V0 - Alpha Basic A11Y和I18N基金会,可访问性和国际化ADM-NF01 01
但我所捕捉到的只是加载屏幕
Capture=time (curl -s -G -L --connect-timeout 100 https://workflowy.com/s/CbqM.M3tcZFhqd3#/?q=ADM-NF01)
只有真正感兴趣的这一行V0 -阿尔法捕捉这一点,才能改变(版本控制),我将通过桥梁,当我得到这一点工作。
有没有办法这样做,试过卷发,但没有运气
主要目标是搜索ie ADM- V0 01并抓取V0- Alpha。
下面是一些例子,https://workflowy.com/s/CbqM.M3tcZFhqd3#/?q=DV-F85 DV-F85 = Vn -未来
https://workflowy.com/s/CbqM.M3tcZFhqd3#/?q=ADM-F71.1 ADM-F71.1 = V1 - Beta
我不知道从哪里开始绑定搜索某人建议的JSON解析,但我知道该如何做,因为我甚至无法获得数据?
谢谢
发布于 2017-07-22 11:05:12
在网络日志中,您可以在以下位置获得JSON内容:
您可以使用jq JSON解析器对特定字段应用过滤器并获得预期的输出:
filter="ADM-NF01"
curl -s "https://workflowy.com/get_initialization_data?share_id=CbqM.M3tcZFhqd3&client_version=18" | \
jq -r --arg filter $filter '.projectTreeData.mainProjectTreeInfo |
.rootProject.nm as $h1 |
.rootProjectChildren[] |
.nm as $h2 |
.ch[] |
.nm as $h3 | .no as $h4 |
select(.ch != null) |
.ch[] | select(.nm == $filter) | $h1,$h2,$h3,$h4,.nm'这意味着:
Feature Roadmap
V0 - Alpha
Basic A11Y and I18N
Foundations for Accessibility and Internationalisation
ADM-NF01关于jq部分:
--arg用于传递筛选值。as $var的变量中。select用于应用筛选器。主要目标是搜索ie ADM- V0 01并抓取V0- Alpha。
如果您只需要V0 - Alpha部分:
filter="ADM-NF01"
data=$(curl -s "https://workflowy.com/get_initialization_data?share_id=CbqM.M3tcZFhqd3&client_version=18" | \
jq -r --arg filter $filter '.projectTreeData.mainProjectTreeInfo |
.rootProjectChildren[] | .nm as $h2 |
.ch[] | select(.ch != null) |
.ch[] | select(.nm == $filter) | $h2')
echo "$data"注意,==完全匹配,如果需要包含,可以使用:
select(.nm | contains($filter))https://stackoverflow.com/questions/45252678
复制相似问题