J'extrais des URL d'un site Web en utilisant cURL comme ci-dessous.
curl www.somesite.com | grep "<a href=.*title=" > new.txt
Mon fichier new.txt est comme ci-dessous.
<a href="http://website1.com" title="something">
<a href="http://website1.com" information="something" title="something">
<a href="http://website2.com" title="some_other_thing">
<a href="http://website2.com" information="something" title="something">
<a href="http://websitenotneeded.com" title="something NOTNEEDED">
Cependant, je dois extraire uniquement les informations ci-dessous.
<a href="http://website1.com" title="something">
<a href="http://website2.com" information="something" title="something">
J'essaie d'ignorer ceux <a href
qui contiennent des informations et dont le titre se termine par NOTNEEDED .
Comment puis-je modifier ma déclaration grep?
curl www.somesite.com | grep "<a href=.*title=" | grep -v NOTNEEDED > new.txt
?