A Project of Computer Science Weather Forecasting Python Programming
A Project of Computer Science Weather Forecasting Python Programming
FORECASTING
J.N.V. KIRTANPUR BAHRAICH
SESSION 2023-24
DIRECTED BY :
SANJAY KUMAR PATHAK
DEVLOPED BY:
PRASHANT GAUTAM
RAGHVENDRA SINGH RANA
MUKESH KUMAR
TEAM:
WEATHER
FORECASTING
A PYTHON PROJECT
mausam.py
REQUIRED MODULES:
IMPORT MODULES
After installation we will import all
modules that is essential for this
programming.
USER-AGENT HEADER:
city=city.replace(" ","+"):
•Replaces spaces in the city name with plus signs to
make the search query URL-friendly.
res =
requests.get(f'https://www.google.com/search?q=
{city}&oq=
{city}&aqs=chrome.0.35i39l2j0l4j46j69i60.6128j1j7&
sourceid=chrome&ie=UTF-8',headers=headers):
print("Searching......\n"):
• Displays a "Searching..." message.
soup = BeautifulSoup(res.text,'html.parser'):
location = soup.select('#wob_loc')
[0].getText().strip():
time = soup.select('#wob_dts')[0].getText().strip():
info = soup.select('#wob_dc')[0].getText().strip():
location.
information.
symbol.
USER INPUT AND FUNCTION CALL:
OUTPUT 02 (SRAWASTI)
OUTPUT 03 (BALLIA)
TEAM
THIS SIDE