]> git.nbdom.net Git - nb.git/commitdiff
Fix
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 14 May 2023 23:16:10 +0000 (01:16 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 14 May 2023 23:16:10 +0000 (01:16 +0200)
lib/postgres/html_attribute.sh

index 0944487e3097c1e91c1a49d6e3b4497a128fd809..fadb700ef1b3920be50f0d7bba2b8ab6a71cc7eb 100755 (executable)
@@ -2,6 +2,6 @@
 http_get https://html.com/attributes/ \
 | sed -E "s,<(thrive_headline|header)[^.>]+>([^<]+)</\1>,<div>\2</div>," \
 | xmllint --html --xpath //table - 2>/dev/null \
-| sed -E "s,<a[^>]+href=.(https://html.com/attributes/([^/]+)[^\"]*)[^<]+</a>,\2</td><td>\1,g" \
+| sed -E "s,<a[^>]+href=\"((https://html.com)?/attributes/([^\"\/]+)\/?)[^<]+</a>,\3</td><td>https://html.com/\1,g" \
 | xml2csv - \
 | awk 'BEGIN{FS="\t"}{print $1"\t"$3"\t"$2}' \