Created
May 1, 2020 12:10
-
-
Save jinnosux/3116292b059ea846c12d91f8d4696b9b to your computer and use it in GitHub Desktop.
Weather crawler from DarkSky
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
#Get website with cordinates of my city ( Novi pazar | |
data = requests.get("https://darksky.net/forecast/43.1379,20.5124/si12/en") | |
soup = BeautifulSoup(data.text, "html.parser") | |
soup.prettify() | |
#Selecting specific div on website which contains elements we like to display | |
results=soup.find_all('span', class_='desc swap') | |
print("Temperature for today is :") | |
print(results[0].text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment