例如,我想从https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main获取所有模型下载链接:
我打开chrome dev tool,输入Xpath:
> $x("/html/body/div/main/div/section/div[3]/ul/li/a[1]/@href")
< (30) [href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href, href]
我怎样才能很好地打印所有真实的href,以便我可以复制粘贴到纯文本文件?
例如:
https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/.gitattributes
https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/README.md
https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p.pth
https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p.yaml
...
...
1条答案
按热度按时间vfh0ocws1#
由于Chrome的
$x()
实用程序返回一个数组,因此您可以将其 * Map * 为您想要的任何格式。比如...