Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- url = "https://yandex.ru/pogoda/moscow"
- response = requests.get(url)
- html = BeautifulSoup(response.content, "lxml")
- def temp():
- return html.find("span", {'class': 'temp__value'}).text
- def wind_speed():
- return html.find("span", {'class': 'wind-speed'}).text
- def davlenie():
- return html.find("dl", {'class': 'fact__pressure'}).dd.text
- def main():
- t = temp()
- wind = wind_speed() + "ΠΌ/Ρ"
- davl = davlenie()
- print(t, wind, davl)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement