Created
August 25, 2017 00:18
-
-
Save alexandre-mbm/3d2c5272a853ee45b4be3040f60d479c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="http://www.sine.rn.gov.br/Conteudo.asp?TRAN=ITEM&TARG=21137&ACT=&PAGE=0&PARM=&LBL=Vagas" | |
HTML=$(wget -q "$URL" -O- | html2text | iconv -f ISO_8859-1 -t UTF8) | |
#echo "$HTML" | grep "Total" | awk '{ print $2 } ' | head -n 1 | |
#echo "$HTML" > sine.txt | |
N=$(echo "$HTML" | awk '/VAGAS PERMANENTES/{print NR}' | head -n 1) | |
M=$(echo "$HTML" | awk '/Total/{print NR}' | head -n 1) | |
N=$(expr $N + 3) | |
M=$(expr $M - 1) | |
echo "$HTML" | sed $N,$M!d | |
#cat sine.txt | awk 'BEGIN { RS="VAGAS PERMANENTES"; FS="Total"; } { print $1 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment