i have been able to use the code below to grep lists of urls from html source before, but for some reason it's not working for this specific example.
grep:
grep -1 box-download shareit1.txt|sed 's/<a/\/n/'|sed 's/href/\/n/'|grep http|cut -d\" -f2>> shareit2.txt
url:
<div class="box-download">
<a data-no-file="0" title="SHAREit free download" href="http://gsf-cf.softonic.com/c98/1a8/173dd01ec9001985d81eb5f2023b03280c/LenovoShareIt-win.exe?SD_used=0&channel=WEB&fdh=no&id_file=69703978&instance=softonic_en&type=PROGRAM&Expires=1444364906&Signature=SdKSfTDHY4dG6HVu2--lqt8lRbGK9S1opIDZiSNwvggAAAXB3hESz1G1Y00rU5iLGY5lai0YOJBXhE4y6gvL4uQvCV4U5jzLDU9TmFTxe4xNDrEmkSC95LyGdGSudQKfrWdD06gBlVrqE49AeeotENtdA3SpkmfQGGd1tnjS138_&Key-Pair-Id=APKAJUA62FNWTI37JTGQ&filename=LenovoShareIt-win.exe" id="download-button" class="button-main-download-xl"
data-ua="#c,#l,a=Download,downloadType=HostedDownload"
>
<strong>Free Download
<span>Safe download</span>
</strong>
<i class="icon-download-alt"></i>
</a>
Appreciate the help.
grep -Poz 'href="\K[^"]*' file.html
lynx -force_html -dump --listonly shareit1.txt
.^
), number, vote down (v
) and accept (✓
). You can cast votes for any number of answers. If you think that answer is well-written and helpful, it deserves up vote - use^
. You can also accept answer, but only one for question.✓
is for answer that is the highest quality of all or directly solved your problem.