Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 16 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /