I see other questions similar to this on SO but none solved my problem.
I have a local html page that I want to extract the links but I don't just want the links I want the whole tag that creates the links, like
<a href="page1.html">My Page 1</a>
<a href="page2.html">My Page 2</a>
<a href="page3.html">My Page 3</a>
I am fine with this if it is easier
My Page 1
page1.html
My Page 2
page2.html
My Page 3
page3.html
I have tried this command that is an answer on another question on SO
grep "<a href=" t2.html |
sed "s/<a href/\\n<a href/g" |
sed 's/\"/\"><\/a>\n/2' |
grep href
but for some reason it is just extracting a couple of links from the page
If you want to see, this is the page I am trying to extract the links.
thanks