]> git.nbdom.net Git - nb.git/commitdiff
html_attribute.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 5 Dec 2020 09:39:55 +0000 (09:39 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 5 Dec 2020 09:39:55 +0000 (09:39 +0000)
lib/postgres/html_attribute.sh

index 559fccf5000bc3e419c6f5d3b9d10b4c3751e196..aa17677bf8909c48eaa7a0686cd8d4b296748663 100755 (executable)
@@ -4,3 +4,8 @@ http_get https://html.com/attributes/ \
 | xmllint --html --xpath //table - 2>/dev/null \
 | sed -E \
   -e "s,<a[^>]+href=.https://html.com/attributes/([^/]+)[^<]+</a></td>[^<]*<td>,\1,g" \
+| xml2csv - \
+| sed -E \
+  -e "s/”/\"/g" -e "s,^[^<]+(<[^>]+>)[^\t]+,\L\1," \
+  -e "s,^(<([^ ]+) ([^=>]+)),https://html.com/attributes/\2-\3/\t\1," \
+| awk 'BEGIN{FS="\t"}{print $2"\t"$3"\t"$1}' \