Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从实时文档中获取链接内的图像。以下作品:
(html/select nodes [:a :img])
但是这样我只得到图像节点,我也想要链接!
所以下一步是
(html/select nodes [:a (html/has [:img])])
但由于某种原因,这只会返回一个空列表。我试图浏览文档并阅读源代码,似乎这应该返回带有 img 标签的链接作为孩子,但也许我错过了一些东西(或者这是一个错误)
好的,想通了。这需要第二组括号。为什么?我试图阅读文档,但我不确定(关于和规则的东西)。无论如何,这就是答案。
(html/select nodes [[:a (html/has [:img])]])