Skip to content

Instantly share code, notes, and snippets.

@jinnosux
Created May 1, 2020 12:10
Show Gist options
  • Save jinnosux/3116292b059ea846c12d91f8d4696b9b to your computer and use it in GitHub Desktop.
Save jinnosux/3116292b059ea846c12d91f8d4696b9b to your computer and use it in GitHub Desktop.
Weather crawler from DarkSky
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