I have a working Bash script to extract title tags. I need help with an AWK field separator for extracting meta tags from HTML, like these:
<meta name="keywords" content="key1, key2, key3">
my script works to extract title, but meta name
doesn't work.
#!/bin/bash
for LINE in `cat htmls.txt`
do
echo $LINE
awk 'BEGIN{IGNORECASE=1;FS="<title>|</title>";RS=EOF} {print $2}' $LINE |
awk '{ if (NF > 0) printf("%s\n", $0); }'
done
I guess I need a regex solution. Any ideas?
Just do this:
To get from website, use
wget
first install xml2 e.g.
Output