Skip to content

Commit 326d091

Browse files
Get Weather Updates using Python
1 parent d6fadc5 commit 326d091

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

WeatherApp/weatherapp.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
4+
#city = input("Enter City: ")
5+
6+
search = "weather in"+ input("Enter City: ")
7+
8+
url = f"https://www.google.com/search?&q={search}"
9+
10+
r = requests.get(url)
11+
12+
s = BeautifulSoup(r.text, "html.parser")
13+
14+
update = s.find("div", class_="BNeawe").text
15+
16+
print(update)

0 commit comments

Comments
 (0)