Build a Weather App in Django | Scrape Weather Data from Google | Beautiful Soup | Python Requests

preview_player
Показать описание
In this video, we are gonna be building a weather application in Django. We will be using beautiful soup python library to fetch the weather data from google. We will also make use of Python requests library to make a request to the url and fetch the response html document. This is what we are going to do to build a weather app in Django in short:

1) Create a project directory.
2) Make a virtual environment (virtualenv)
3) Create a new django project.
4) Make a django application named core.
5) Set up basic urls.
6) Initially, set up a view which renders an html page.
7) Build a basic html and css template.
8) Make a request to google url and fetch the response html page using Python requests library.
9) Leverage Beautiful Soup Library to scrape the data from the html page such as region, day time, temperature etc.
10) Refactor the view and html template.
11) Overview of external weather API available such as openweathermap API.

Subscribe | Code Band

Other videos in Code Band:

:) You Can Find Me On:
Рекомендации по теме
Комментарии
Автор

Hey. Great video, really easy to follow, thank you. You're probably sick of this question already but I'm getting the same attribute error as a lot of people below. Tried wrapping it in a try/except, checked the selectors are up to date, and even added the recent sleep suggestion. Still nothing.

result['region'] = soup.find("div", attrs={"id": "wob_loc"}).text

Very new to Django and coding in general so haven't been able to solve it myself. Any other suggestions?

imEndiii
Автор

Really cool Jasim, I'll have to spend some time playing around with this code. I love seeing how others code similar applications.

Saw this video come across my linked feed. Subscribed :)

DennisIvy
Автор

great video bro, this was solution i was looking for from past 3 days..finally u made my day!!!

pulsarlover
Автор

Bro you're the best this actually works thank you so much !!!! please create more videos like this thank you so much god blessed you 😊😊😊

allenunicruz
Автор

Towards the end, in home.html, you used the 'IF' jinja tag to check whether 'WEATHER' is true or not inorder to print the output. I had a doubt here because shouldn't it return an error because you didn't initialise weather to false before? And thus it won't know what that 'WEATHER' condition is.
Sorry if i missed something obvious. Thanks for the help. It was a great video.

heavenlypenguin
Автор

Brilliant! Right pace, right explanations - subscribed! Video request: create apis using django: for example a histogram app from an open-source dataset.

nibeditadatta
Автор

Thank You so much bro ..You are a life saver just exactly what i wanted.. One suggestion - In the title it says beautiful so if you can just update the html doc and make it more pretty it will look just fabulous
Keep up the good work :)

rohitbhapkar
Автор

Love it!! Thank you for this video, I was looking exactly for this, hey can you do it with scrapy. Or it's just the same

BlhJ
Автор

Excelent video. If the selector I want to call is an img tag I can't use the .text, so what would be used? please help me

evelynmilagrosrodriguezchi
Автор

super work bro
really helpful make some other project
in Django like this😎👍

meghpatel
Автор

Thanks making this video on this topic.
More help required for
Suppose visit site this site open new tab how to handle it?

kameshs
Автор

How did you find soup.find("div", attrs={"class": "BNeawe iBp4i AP7Wnd"}) in the inspect?
I did not find that class.

preet_dhiman
Автор

Can i follow same for postal code(pincode), that means scraping from Google ?

surendrasrikakolapu
Автор

Hey! Great Job! I was wondering if you could post one tutorial about heavy web scrapping and using celery. That would help.

codehubSEO
Автор

can i scrape any website's video with beautifulsoup and show them in my website's front page?

antorzuck
Автор

Hey great video, which is one is easy weather scraping or using api

RaySprk
Автор

Bro how did you find soup.find("div", attrs={"class": "BNeawe iBp4i AP7Wnd"}) please help where is it in the inspect?

vaibhavdiwan
Автор

Thank You so much I understood everything. Way of teaching is also Good. Can you place make video on Coronavirus data analysis also. Means like you search weather of different city like that if someone type city name then there active cases etc need to be printed and one graph showing this . BTW thank You for this .

softwareengineer_marwadi_women
Автор

is it good approach to use selenium
to scrape using django ?

zaidyousaf
Автор

Hi there, in the extracting of region when i run the program iam always getting the same error of 'NoneType' object has no attribute 'text' i tried to follow the video thoroughly and still i am getting the same error so please tell me what have I been doing wrong

msawadh