Data Science – 3 [web scraping]
Retrieve current temperature using BeautifulSoup #extract current temp import requests import bs4 #url=”https://weather.com/en-IN/weather/today/l/12.96,77.59?par=google&temp=c” url=”https://weather.com/en-IN/weather/today/l/17.31,76.81?par=google&temp=c” r=requests.get(url) soup=bs4.BeautifulSoup(r.text, “html.parser”) val= soup.find(‘span’, “data-testid=’TemperatureValue'”, class_=’CurrentConditions–tempValue–3KcTQ’) print(“Current temp is : “, val.text) Output of the above program is : Current temp is : 30° 2. To check live price, title and ratings of particular product #data science with Python – …