Using curl, grep, and sed to extract data from HTML
If I understand your requirement right, you want to extract the text between <strong...class="...">
and </strong>
, I would use single grep to save your grep|grep|sed|sed...
:
also use -s
option of curl:
kent$ curl -s "link"|grep -Po '<strong\s+class="main_entry_word">\K.*?(?=</strong>)'
output:
palmy