Aug-19-2022, 04:59 AM
Images(svg) are just use as backgrounds,need to parse the values needed.
A example.
A example.
import bs4, requests, webbrowser LINK = "https://www.meteo.it/meteo/roma-oggi-58091" response = requests.get(LINK) response.raise_for_status() soup = bs4.BeautifulSoup(response.content, 'html.parser') # can just copy CSS selector from browser(inspect Dev Tools) weather_info = soup.select_one('#main-locations > nav > div > div:nth-child(1)')
>>> weather_info.text 'Roma27°' >>> weather_info.p.text 'Roma' >>> weather_info.p.next_sibling.text '27°' >>> # The image used as background for tag over >>> weather_info.img.get('src') '//w-static.meteosuper.it/public/icons/ic_cloudy_day_100px_10_26.svg