Skip to content

Instantly share code, notes, and snippets.

@fdaciuk
Created May 24, 2014 17:52
Show Gist options
  • Save fdaciuk/22cad0839e892f7616bb to your computer and use it in GitHub Desktop.
Save fdaciuk/22cad0839e892f7616bb to your computer and use it in GitHub Desktop.
Extrair classes de um arquivo HTML.md

Extrair classes de um arquivo HTML

O comando abaixo imprime no terminal todas as classes do arquivo passado. No caso, o index.html:

cat index.html | grep class= |cut -d \" -f2
@fdaciuk
Copy link
Author

fdaciuk commented May 24, 2014

Para pegar o href:

cat index.html | grep -o '<a .*href=.*>' | sed -e 's/<a /\<a /g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment