skip to Main Content

How to find out all <a> tag links and names from html file – Ubuntu

Here is a test file contains links and names within the <a></a> tags. /tmp/test_html.txt <tr> <td><a href="http://www.example.com/link1">example link 1</a></td> </tr> <tr> <td><a href="http://www.example.com/link2">example link 2</a></td> </tr> <tr> <td><a href="http://www.example.com/link3">example link 3</a></td> </tr> <tr> <td><a href="https://www.example.com/4/0/1/40116601-1FDC-real-world-link/bar" target="_blank" class="real-world-class">Real World Link</a>&nbsp;</td> </tr>…

VIEW QUESTION

How can I change my program to let it display the output – Ubuntu

I'm trying to print out the happiest countries in the world for 2022, by receiving the data from https://en.wikipedia.org/wiki/World_Happiness_Report?action=raw). and then editing displaying the first 5 countries. Here is my code: #!/bin/bash content=$(curl -s "https://en.wikipedia.org/wiki/World_Happiness_Report?action=raw") lines=$(echo "$content" | grep '^|'…

VIEW QUESTION
Back To Top
Search