Use awk
$ wget http://www.weatherzone.com.au/sa/adelaide/adelaide
$ awk -F '[<|>|&]' '/tempnow/ {print $3}' adelaide
20.0
ou all-in-one
$ wget -q -O- http://www.weatherzone.com.au/sa/adelaide/adelaide | awk -F '[<|>|&]' '/tempnow/ {print $3}'
20.1
Isso funciona desde que o atributo class
com o valor tempnow
esteja disponível na tag span
.
<span id="top_obs_temp" class="tempnow">18.6°C</span>
E agora estou na lista negra o_O : P
wget http://www.weatherzone.com.au/sa/adelaide/adelaide
--2015-11-06 08:17:37-- http://www.weatherzone.com.au/sa/adelaide/adelaide
Resolving www.weatherzone.com.au (www.weatherzone.com.au)... 104.101.241.181
Connecting to www.weatherzone.com.au (www.weatherzone.com.au)|104.101.241.181|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2015-11-06 08:17:37 ERROR 403: Forbidden.