{"id":301771,"date":"2020-04-13T15:00:39","date_gmt":"2020-04-13T15:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301771"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-04-13T15:00:39","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301771","title":{"rendered":"\u0414\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0433\u043e\u0434\u0430 \u043d\u0430 Python \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e requests \u0438 bs4"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/496988\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u00ab\u041f\u043e\u0433\u043e\u0434\u0430\u00bb \u043d\u0430 Python \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e requests \u0438 bs4.<br \/>  \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430?<\/p>\n<ol>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 \u0432 \u0432\u0430\u0448\u0435\u043c \u0433\u043e\u0440\u043e\u0434\u0435.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0432\u043e\u0437\u0434\u0443\u0445\u0430.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u0430\u0434\u043a\u0438.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c.<\/li>\n<li>\u0418 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0435\u0442\u0440\u0430.<\/li>\n<\/ol>\n<p>  \u0424\u0440\u043e\u043d\u0442 \u0440\u0430\u0431\u043e\u0442 \u044f\u0441\u0435\u043d, \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c<\/h1>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0438 requests \u0438 bs4 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b: <\/p>\n<pre><code class=\"python\">pip install requests bs4<\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u00abWeatherApp\u00bb.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b main.py<\/p>\n<h1>\u041f\u0438\u0448\u0435\u043c \u043a\u043e\u0434<\/h1>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u0438:<\/p>\n<pre><code class=\"python\">import requests import os import time from bs4 import BeautifulSoup<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">os.system(&quot;cls&quot;)#\u041e\u0447\u0438\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c<\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0430\u0439\u0442, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u0441\u0430\u0439\u0442 <a href=\"https:\/\/www.google.com\/search?sxsrf=ALeKk02B-rwjd_voK5Scd2O1FIP-lLKvUg%3A1586500409376&amp;ei=OROQXsPPFpL8kwX0hIaYBQ&amp;q=google+%D0%BF%D0%BE%D0%B3%D0%BE%D0%B4%D0%B0&amp;oq=google+%D0%BF%D0%BE&amp;gs_lcp=CgZwc3ktYWIQAxgAMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLAToECAAQRzoECAAQQzoCCAA6BAgjECdKFAgXEhA3LTEzN2cxNTFnMzU3Zzg0Sg0IGBIJNy0xZzFnMWc0UJk0WL1CYJNPaABwAngBgAGgA4gBuRCSAQkwLjUuMS4yLjGYAQCgAQGqAQdnd3Mtd2l6&amp;sclient=psy-ab\">Google Weather.<\/a><\/p>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/i3\/85\/nr\/i385nrhxmi4dyw0pynwd2ctqxfk.jpeg\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e SITE \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0435 URL:<\/p>\n<pre><code class=\"python\">SITE = 'https:\/\/www.google.com\/search?sxsrf=ALeKk02B-rwjd_voK5Scd2O1FIP-lLKvUg%3A1586500409376&ei=OROQXsPPFpL8kwX0hIaYBQ&q=google+%D0%BF%D0%BE%D0%B3%D0%BE%D0%B4%D0%B0&oq=google+%D0%BF%D0%BE&gs_lcp=CgZwc3ktYWIQAxgAMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLAToECAAQRzoECAAQQzoCCAA6BAgjECdKFAgXEhA3LTEzN2cxNTFnMzU3Zzg0Sg0IGBIJNy0xZzFnMWc0UJk0WL1CYJNPaABwAngBgAGgA4gBuRCSAQkwLjUuMS4yLjGYAQCgAQGqAQdnd3Mtd2l6&sclient=psy-ab'<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c, \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0431\u043e\u0442 \u0438 \u043d\u0430\u0448 URL \u0430\u0434\u0440\u0435\u0441 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043a\u043b\u044e\u0447\u043e\u043c User-Agent, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 Google \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 my user agent.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c headers:<\/p>\n<pre><code class=\"python\">headers = {'User-Agent': 'Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36'} #\u0412 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u0430\u0448 User-Agent<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e full_page \u043a\u043e\u0442\u043e\u0440\u043e\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0441\u0430\u0439\u0442\u0430.<\/p>\n<pre><code class=\"python\">full_page = requests.get(SITE, headers=headers)# \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0441\u0430\u0439\u0442\u0430 #Google Weather # \u041f\u0435\u0440\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 full_page \u044d\u0442\u043e URL \u0441\u0430\u0439\u0442\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438<\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e!<\/p>\n<p>  \u0421 requests \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0443\u0436\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0442\u0435\u0433\u0438 \u0441 \u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0438 \u0438\u0434\u0435\u043d\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438.<\/p>\n<p>  \u041f\u0438\u0448\u0435\u043c:<\/p>\n<pre><code class=\"python\">soup = BeautifulSoup(full_page.content, 'html.parser')<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0437\u043d\u0430\u0435\u043c \u043f\u043e\u0433\u043e\u0434\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0430\u0439\u0442 Google Weather \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u043d\u0435\u043b\u044c<br \/>  \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448 Ctrl+Shift+I.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vn\/_r\/w9\/vn_rw9as2nh7kurzk6b22rxm3cm.jpeg\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0436\u043c\u0435\u043c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/41\/_p\/ct\/41_pct31celopmkzjyhxtbdyeow.jpeg\"\/><\/p>\n<p>  \u0410 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u0442\u0435\u043a\u0441\u0442 \u0441 \u043f\u043e\u0433\u043e\u0434\u043e\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nt\/yv\/-y\/ntyv-y9fg36ytrf_nvjglto-tka.jpeg\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043e\u043a\u043d\u0435 \u0440\u0430\u0437\u0440\u043e\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0443 \u043d\u0430\u0441 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0438\u043b\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0439 \u0442\u0435\u0433:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/aq\/k4\/bk\/aqk4bkkme86s4ileix9jhufacfy.jpeg\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c: \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0435\u0433 span \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c vk_gy vk_sh \u0438 \u0438\u0434\u0435\u043d\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c wob_dc. <\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0417\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0433\u043e\u0434\u0430!<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 \u043a\u043e\u0440\u0442\u0435\u0436\u0435 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u043f\u043e\u0433\u043e\u0434\u044b:<\/p>\n<pre><code class=\"python\">weather = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;vk_gy vk_sh&quot;, &quot;id&quot;: &quot;wob_dc&quot;}) # \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u043e\u0434\u0430 \u043c\u044b \u0438\u0449\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u0439 HTML \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0442\u0435\u0433 span \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c vk_gy vk_sh # \u0438 \u0438\u0434\u0435\u043d\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c wob_dc <\/code><\/pre>\n<p>  \u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u043d\u0435\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 (Ctrl+Shift+I).<\/li>\n<li>\u0414\u0430\u043b\u0435\u0435 \u0436\u043c\u0435\u043c \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0443 \u00ab\u0412\u044b\u0431\u0440\u0430\u0442\u044c\u00bb.<\/li>\n<li>\u0416\u043c\u0435\u043c \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<\/li>\n<li>\u0418\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0442\u0435\u0433\u0438, \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0438\u0434\u0435\u043d\u0434\u0438\u0444\u0438\u043a\u043e\u0442\u0435\u0440\u044b.<\/li>\n<\/ol>\n<p>  \u0412\u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">temperature = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_tm&quot;}) precipitation = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_pp&quot;}) hamidite = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_hm&quot;}) wind = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_ws&quot;})<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043d\u0435\u0441\u0442\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0432\u0438\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\"> wind_var = wind[0].text # \u0417\u0430\u043d\u043e\u0441\u0438\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e wind_var \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 wind_lst = [] # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0437\u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0442\u0440\u0430 wind_lst.append(wind_var)# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u0442\u0430\u043a \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043a\u043e\u0440\u0442\u0435\u0436\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">hamidite_var = hamidite[0].text hamidite_lst = [] hamidite_lst.append(hamidite_var)  precipitation_var = precipitation[0].text precipitation_lst = [] precipitation_lst.append(precipitation_var)  weather_var = weather[0].text weather_var_lst = [] weather_var_lst.append(weather_var)  temp = tempreture[0].text temp_lst = [] temp_lst.append(temp) <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u041f\u043e\u0433\u043e\u0434\u044b, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442.\u0434, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\"> def current_weather(): \tfull_page = requests.get(SITE, headers=headers)#\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \tsoup = BeautifulSoup(full_page.content, 'html.parser') \t \twind = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_ws&quot;})#\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0435\u0442\u0440\u0430 \twind_var = wind[0].text \tif wind_var != wind_lst[0]:#\u0415\u0441\u043b\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0435\u0442\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0442\u043e \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u0437\u0430\u043d\u0435\u0441\u0442\u0438 \u0432 \u043d\u0435 \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \t\tos.system(&quot;cls&quot;)#\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u044d\u043a\u0440\u0430\u043d \t\twind_lst.clear()#\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \t\twind_lst.append(wind_var)#\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \t\tprint(&quot;Weather:&quot;, weather_var_lst[0])#\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0441\u0442 \t\tprint(&quot;Temperature:&quot;, temp_lst[0] + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitaion:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0]) <\/code><\/pre>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u043c \u0441 \u043e\u0442\u0441\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438:<\/p>\n<pre><code class=\"python\">         hamidite = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_hm&quot;}) \thamidite_var = hamidite[0].text \tif hamidite_var != hamidite_lst[0]: \t\tos.system(&quot;cls&quot;) \t\thamidite_lst.clear() \t\tHamidate_lst.append(hamidite_var) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0])  \tprecipitation = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_pp&quot;}) \tprecipitation_var = precipitation[0].text \tif precipitation_var != precipitation_lst[0]: \t\tos.system(&quot;cls&quot;) \t\tprecipitation_lst.clear() \t\tprecipitation_lst.append(precipitation_var) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0])  \tweather = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;vk_gy vk_sh&quot;, &quot;id&quot;: &quot;wob_dc&quot;}) \tweather_var = weather[0].text \tif weather_var != weather_var_lst[0]: \t\tos.system(&quot;cls&quot;)  \t\tweather_var_lst.clear() \t\tweather_var_lst.append(weather_var) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0])  \ttempreture = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_tm&quot;})  \ttemp = tempreture[0].text \ttemp = int(temp) \tif temp != temp_lst[0]: \t\tos.system(&quot;cls&quot;) \t\ttemp_lst.clear() \t\ttemp_lst.append(temp) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0]) \ttime.sleep(5)#\u0416\u0434\u0430\u0442\u044c 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0447\u0442\u043e \u0431\u044b \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u0446\u0438\u043a\u043b \u0438 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c:<\/p>\n<pre><code class=\"python\">try: \tprint(&quot;Weather:&quot;, weather_var_lst[0]) \tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \tprint(&quot;Wind:&quot;, wind_lst[0]) \twhile True: \t\tcurrent_weather() except: \tquit()<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0435\u0435 \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442 \u0442\u0430\u043a \u043a\u0430\u043a \u0446\u0438\u043a\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 try.<\/p>\n<p>  \u0412\u043e\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\"> import requests import os import time from bs4 import BeautifulSoup  os.system(&quot;cls&quot;)  SITE = 'https:\/\/www.google.com\/search?sxsrf=ALeKk02B-rwjd_voK5Scd2O1FIP-lLKvUg%3A1586500409376&ei=OROQXsPPFpL8kwX0hIaYBQ&q=google+%D0%BF%D0%BE%D0%B3%D0%BE%D0%B4%D0%B0&oq=google+%D0%BF%D0%BE&gs_lcp=CgZwc3ktYWIQAxgAMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLATIFCAAQywEyBQgAEMsBMgUIABDLAToECAAQRzoECAAQQzoCCAA6BAgjECdKFAgXEhA3LTEzN2cxNTFnMzU3Zzg0Sg0IGBIJNy0xZzFnMWc0UJk0WL1CYJNPaABwAngBgAGgA4gBuRCSAQkwLjUuMS4yLjGYAQCgAQGqAQdnd3Mtd2l6&sclient=psy-ab' headers = {'User-Agent': 'Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/80.0.3987.163 Safari\/537.36'} #\u0412 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432\u0430\u0448 User-Agent  full_page = requests.get(SITE, headers=headers)# \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0441\u0430\u0439\u0442\u0430 #Google Weather # \u041f\u0435\u0440\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 full_page \u044d\u0442\u043e URL \u0441\u0430\u0439\u0442\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 soup = BeautifulSoup(full_page.content, 'html.parser')  weather = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;vk_gy vk_sh&quot;, &quot;id&quot;: &quot;wob_dc&quot;}) # \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u043e\u0434\u0430 \u043c\u044b \u0438\u0449\u0435\u043c \u043f\u043e \u0432\u0441\u0435\u0439 HTML \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0442\u0435\u0433 span \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c vk_gy vk_sh # \u0438 \u0438\u0434\u0435\u043d\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c wob_dc temperature = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_tm&quot;}) precipitation = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_pp&quot;}) hamidite = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_hm&quot;}) wind = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_ws&quot;})  wind_var = wind[0].text # \u0417\u0430\u043d\u043e\u0441\u0438\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e wind_var \u0442\u0435\u043a\u0441\u0442 \u0438\u0437 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 wind_lst = [] # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0437\u0436\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0442\u0440\u0430 wind_lst.append(wind_var)# \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442  hamidite_var = hamidite[0].text hamidite_lst = [] hamidite_lst.append(hamidite_var)  precipitation_var = precipitation[0].text precipitation_lst = [] precipitation_lst.append(precipitation_var)  weather_var = weather[0].text weather_var_lst = [] weather_var_lst.append(weather_var)  temp = temperature[0].text temp_lst = [] temp_lst.append(temp)  def current_weather(): \tfull_page = requests.get(SITE, headers=headers)#\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \tsoup = BeautifulSoup(full_page.content, 'html.parser') \t \twind = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_ws&quot;})#\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0435\u0442\u0440\u0430 \twind_var = wind[0].text \tif wind_var != wind_lst[0]:#\u0415\u0441\u043b\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0435\u0442\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0442\u043e \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u0437\u0430\u043d\u0435\u0441\u0442\u0438 \u0432 \u043d\u0435 \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \t\tos.system(&quot;cls&quot;)#\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u044d\u043a\u0440\u0430\u043d \t\twind_lst.clear()#\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \t\twind_lst.append(wind_var)#\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \t\tprint(&quot;Weather:&quot;, weather_var_lst[0])#\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u043a\u0441\u0442 \t\tprint(&quot;Temperature:&quot;, temp_lst[0] + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitaion:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0]) \thamidite = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_hm&quot;}) \thamidite_var = hamidite[0].text \tif hamidite_var != hamidite_lst[0]: \t\tos.system(&quot;cls&quot;) \t\thamidite_lst.clear() \t\tHamidate_lst.append(hamidite_var) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0])  \tprecipitation = soup.findAll(&quot;span&quot;, {&quot;id&quot;: &quot;wob_pp&quot;}) \tprecipitation_var = precipitation[0].text \tif precipitation_var != precipitation_lst[0]: \t\tos.system(&quot;cls&quot;) \t\tprecipitation_lst.clear() \t\tprecipitation_lst.append(precipitation_var) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0])  \tweather = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;vk_gy vk_sh&quot;, &quot;id&quot;: &quot;wob_dc&quot;}) \tweather_var = weather[0].text \tif weather_var != weather_var_lst[0]: \t\tos.system(&quot;cls&quot;)  \t\tweather_var_lst.clear() \t\tweather_var_lst.append(weather_var) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0])  \ttempreture = soup.findAll(&quot;span&quot;, {&quot;class&quot;: &quot;wob_t&quot;, &quot;id&quot;: &quot;wob_tm&quot;})  \ttemp = tempreture[0].text \ttemp = int(temp) \tif temp != temp_lst[0]: \t\tos.system(&quot;cls&quot;) \t\ttemp_lst.clear() \t\ttemp_lst.append(temp) \t\tprint(&quot;Weather:&quot;, weather_var_lst[0]) \t\tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \t\tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \t\tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \t\tprint(&quot;Wind:&quot;, wind_lst[0]) \ttime.sleep(5)#\u0416\u0434\u0430\u0442\u044c 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0447\u0442\u043e \u0431\u044b \u0441\u043d\u043e\u0432\u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f  try: \tprint(&quot;Weather:&quot;, weather_var_lst[0]) \tprint(&quot;Temperature:&quot;, str(temp_lst[0]) + &quot;\u00b0C&quot;) \tprint(&quot;Precipitation:&quot;, precipitation_lst[0]) \tprint(&quot;Hamidite:&quot;, hamidite_lst[0]) \tprint(&quot;Wind:&quot;, wind_lst[0]) \twhile True: \t\tcurrent_weather() except: \tquit() <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u0433\u043e\u0434\u044b \u0438\u043b\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0435\u0442\u0440\u0430, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 matplotlib \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/496988\/\"> https:\/\/habr.com\/ru\/post\/496988\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/496988\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u00ab\u041f\u043e\u0433\u043e\u0434\u0430\u00bb \u043d\u0430 Python \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e requests \u0438 bs4.<br \/>  \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430?<\/p>\n<ol>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0433\u043e\u0434\u0443 \u0432 \u0432\u0430\u0448\u0435\u043c \u0433\u043e\u0440\u043e\u0434\u0435.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0432\u043e\u0437\u0434\u0443\u0445\u0430.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0441\u0430\u0434\u043a\u0438.<\/li>\n<li>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c.<\/li>\n<li>\u0418 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u0435\u0442\u0440\u0430.<\/li>\n<\/ol>\n<p>  \u0424\u0440\u043e\u043d\u0442 \u0440\u0430\u0431\u043e\u0442 \u044f\u0441\u0435\u043d, \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-301771","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=301771"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301771\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}