Oct-10-2017, 12:53 PM
i have this script running on my raspberry that is scraping weather report from an url:
http://it.freemeteo.com/tempo/
this is the snippet of the weather prevision html:
<div class="pred"><script type="text/javascript">
document.write(Icons.GetDescription(1,'CurrentWeather'));
</script>SUNNY DAY</div>
i'm using bs4
i do something like this:
<div class="pred"><script type="text/javascript">
document.write(Icons.GetDescription(1,'CurrentWeather'));
</script></div>
the Weather part vanishes
it is probably a problem of the javascript
anyone knows the solution?
cheers
http://it.freemeteo.com/tempo/
this is the snippet of the weather prevision html:
<div class="pred"><script type="text/javascript">
document.write(Icons.GetDescription(1,'CurrentWeather'));
</script>SUNNY DAY</div>
i'm using bs4
i do something like this:
r = requests.get(urlWeather) soup = BeautifulSoup(r.content, 'html.parser') soup.body.find('div', class_="pred")but the result is
<div class="pred"><script type="text/javascript">
document.write(Icons.GetDescription(1,'CurrentWeather'));
</script></div>
the Weather part vanishes
it is probably a problem of the javascript
anyone knows the solution?
cheers