我正在wget
编写一个网页 src 代码,然后使用pup
它来获取<meta>
我需要的标签。现在我只想打印该content
字段的值。
在这种情况下,我想要的输出是:https://example.com/my/folder/first.jpg?foo=bar
# wget page to /tmp/output.html
IMAGE_URL=$(cat /tmp/output.html | pup 'meta[property*="og:image"]')
echo $IMAGE_URL is:
<meta property="og:image" content="https://example.com/my/folder/first.jpg?foo=bar">