I know don't analyze using curl, grep and sed. But I'm looking for an easy approach, not very safe.
So, I get an HTML file with curl, from which I need the value of a specific attribute from the tag. I use grep to get the line where it says token . This happens only once. This gives me a whole div:
<div class="userlinks"> <span class="arrow flleft profilesettings">settings</span> <form class="logoutform" method="post" action="/logout"> <input class="logoutbtn arrow flright" type="submit" value="Log out"> <input type="hidden" name="ltoken" value="a5fc8828a42277538f1352cf9ea27a71"> </form> </div>
How can I get only the value attribute (for example, "a5fc8828a42277538f1352cf9ea27a71")?
source share