{"id":349572,"date":"2023-06-29T15:04:10","date_gmt":"2023-06-29T15:04:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=349572"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=349572","title":{"rendered":"<span>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0431\u043e\u0442 \u00ab\u043d\u0430 \u0434\u0432\u0438\u0436\u043a\u0435\u00bb WEB WhatsApp<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a \u0432\u0441\u0435\u043c!<\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 \u0438\u0437\u0433\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0434 Web \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Whatsapp \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-\u0431\u043e\u0442\u0430. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 python c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438, \u043e\u043d\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043c\u043e\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/737990\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/u><\/a>.  <\/p>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0431\u043e\u0442\u0435 (\u0435\u0433\u043e \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0436\u0435) \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 autoit, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0443 \u0441\u0443\u0442\u044c \u0437\u0430\u0434\u0443\u043c\u043a\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, docker-\u043e\u0431\u0440\u0430\u0437 &amp; etc). \u041d\u0430 \u043d\u0451\u043c \u0432 \u0446\u0438\u043a\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u043e\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443, \u0433\u0434\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u043e\u0442\u0430, \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u043e\u0431\u043e\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0443\u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0430\u0434, \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c &#171;Echo:&#187;. \u041d\u043e \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430, \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e &#171;\u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u0430&#187;.<\/p>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0431\u043e\u0442\u0430. \u041e\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f whatapp(). \u0412 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<ul>\n<li>\n<p>startBrowser &#8212; \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>finish &#8212; \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>searchGroup &#8212; \u0438\u0449\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>sendMessage &#8212; \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u043b\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>searchLastMessageAndProcessMessages &#8212; \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f  \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u043e\u0432\u044b\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443 \u0432\u0441\u0442\u0440\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0431\u043e\u0442\u0430. \u041f\u0435\u0440\u0432\u043e\u0435,  \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0443\u0436\u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 JavaScript, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f DOM, \u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c JavaScript. \u0412\u0442\u043e\u0440\u043e\u0435, \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0430\u0440\u043a\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e \u0435\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0437\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0431\u043e\u0442\u0430. \u0422\u0440\u0435\u0442\u044c\u0435, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u0438, \u0442\u0430\u043a \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0435\u0449\u0435 \u043a\u0430\u043a-\u0442\u043e  \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.  <\/p>\n<p>\u0418 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443, \u0433\u0434\u0435 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f  \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041b\u0443\u0447\u0448\u0435 \u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0432\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u043c\u0443, \u043d\u043e \u044f, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435 \u0441\u0442\u0430\u043b \u0437\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u043e\u0442\u0430.<\/p>\n<p>\u041f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443, \u0447\u0442\u043e \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u043e \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u0432\u043e\u0440\u0438\u0442\u043e\u043c \u0441\u0440\u0435\u0434\u0438 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Whatsapp, \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0435\u043a\u0441\u0442 \u0431\u043e\u0442\u0430. \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u043e \u0445\u043e\u0434\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043d\u0430 \u0434\u0432\u0443\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. <\/p>\n<pre><code class=\"python\">from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.support.ui import WebDriverWait from time import sleep import argparse from datetime import datetime   # \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f Selenium # Constants for Selenium url = f\"https:\/\/web.whatsapp.com\/\" xpath = \"\/\/button[@data-testid='compose-btn-send']\" xpathAttach = \"\/\/div[@data-testid='conversation-clip']\" cssIdOfDocument = \"[aria-label='\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442']\" cssIdOfSendButton = \"[aria-label='\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c']\" xpathSearchField = \"\/\/div[@data-testid='chat-list-search']\" xpathFoundItem = \"\/\/span[contains(@class,'matched-text')]\" xpathInputLineForText = \"\/\/div[@data-testid='conversation-compose-box-input']\" xpathMessage = \"\/\/div[@role = 'row']\" xpathAuthorTime = \"span[contains(@class,'_3FuDI')]\" xpathText1 = \"span[contains(@class,'selectable-text')]\" xpathText2 = \"span[contains(@class,'copyable-text')]\"  commandEnableOrDisableJavaScript = \"Emulation.setScriptExecutionDisabled\"  # \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 # Constants for message process messageIsOutgoing = \"message-out\" messageIsText = \"data-pre-plain-text\" messageClassOfBody = \"selectable-text copyable-text\" messageBodyStart = \"&lt;span>\" messageBodyStop = \"&lt;\/span>\" messageIsPicture = \"img\" messageWarrningAboutPicture = \"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e!  I don't process emoticons !\" fileNameWithLastMessage = \"lastmessage.txt\"  class whatapp():     \"\"\" \u042d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u0431\u043e\u0442\u0430 \u0434\u043b\u044f Whatsapp        This class is bot for Whatsapp\"\"\"       def startBrowser(self):         options = webdriver.ChromeOptions() # \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 FireFox, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u043c options = webdriver.FirefoxOptions() . # if you have the Mozilla Fifefox just write                   options = webdriver.FirefoxOptions()         options.add_argument('--allow-profiles-outside-user-dir')         options.add_argument('--enable-profile-shortcut-manager') # \u0423\u041a\u0410\u0416\u0418\u0422\u0415 \u041f\u0423\u0422\u042c \u0413\u0414\u0415 \u041b\u0415\u0416\u0418\u0422 \u0412\u0410\u0428 python \u0424\u0410\u0419\u041b. \u0421\u043e\u0432\u0435\u0442\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u043d\u0435\u0433\u043e # Specify the path to where your python file is located. I suggest you create a separate folder for it         options.add_argument(r'user-data-dir=X:\\\\YYYYYY\\\\ZZZZZZ\\\\')         options.add_argument('--profile-directory=Profile 1')         options.add_argument('--profiling-flush=n')         options.add_argument('--enable-aggressive-domstorage-flushing')  # \u044d\u0442\u0438 \u043e\u043f\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445  SSL, \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0438 \u0442.\u043f. \u041d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f :( # these options need to disabled any messages about bad ssl, certification &amp; etc         options.add_argument('--ignore-certificate-errors-spki-list')         options.add_argument('--ignore-certificate-errors')         options.add_argument('--ignore-ssl-errors')         options.add_argument('log-level=3') # INFO = 0, # WARNING = 1, # LOG_ERROR = 2, # LOG_FATAL = 3. # default is 0. # \u041c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440 # We are starting a browser         self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options) # \u0436\u0434\u0451\u043c \u0435\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 # it takes some time to load it         wait = WebDriverWait(self.driver, 30) # \u0438\u0434\u0451\u043c \u0442\u0443\u0434\u0430 # go to there         self.driver.get(url) # \u0436\u0434\u0451\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b Whatsapp # we are waiting for Whatsapp page to load         wait.until(EC.element_to_be_clickable((By.XPATH, xpathSearchField)))       def finish(self): # \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 # close all         self.driver.quit()      def searchGroup(self, group_name): # \u041d\u0430\u0439\u0442\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 # \u0412 \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \"\u0418\u0441\u043a\u0430\u0442\u044c\" # Find a group to process # In the search field, enter the name of the group and click \"Search\".         self.driver.find_element(By.XPATH, xpathSearchField).send_keys(group_name)         self.driver.find_element(By.XPATH, xpathFoundItem).click()         sleep(5)       def sendMessage(self, message): # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c JavaSctipt # Enable JavaSctipt         self.driver.execute_cdp_cmd(commandEnableOrDisableJavaScript, {'value': False}) # \u0418\u0449\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0443\u0434\u0430 \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # Find the input line and send the message text there         self.driver.find_element(By.XPATH, xpathInputLineForText).send_keys(message) # \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0449\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\" \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043d\u0435\u0435 # now we look for the Send Button and click on it         self.driver.find_element(By.XPATH, xpath).click()         sleep(5)       def searchLastMessageAndProcessMessages(self, dt): # \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c JavaSctipt # Disable   JavaSctipt         self.driver.execute_cdp_cmd(commandEnableOrDisableJavaScript, {'value': True}) # \u0412\u044b\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # Select all messages         messages = self.driver.find_elements(By.XPATH, xpathMessage)         print(str(dt) + '. I found %s messages' % len(messages)) # \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 # Get the last processed message from file         f = open(fileNameWithLastMessage, \"r\")         last_message = f.read()         f.close()         need_process = False # \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # review all messages         for item in messages: # \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # get body of the message             line = str(item.get_attribute('innerHTML')) # \u044d\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c # this is outgoing message... skip it             if (messageIsOutgoing in line):                  continue # \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043d\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430. \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c # this message without text... skip it             if not (messageIsText in line):                  continue # \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043c \u0434\u0430\u0442\u0443, \u0432\u0440\u0435\u043c\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # extract date, time and author from the message             index1 = line.index(messageIsText)             index2 = line.index(\"]\", index1 + len(messageIsText))             index3 = line.index(\":\", index2)             author_datetime = line[index1 + len(messageIsText) + 2 : index3] # \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # extract text from the message             index1 = line.index(messageClassOfBody)             index2 = line.index(messageBodyStart, index1 + len(messageClassOfBody))             index3 = line.index(messageBodyStop, index2)             message = line[index2 + len(messageBodyStart): index3] # \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u043c # create a complete message for comparison with the last processed message             full_message = author_datetime + \" \" + message # \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435, \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0432 \u044d\u0442\u043e # if the message was last processed, we start processing by skipping this             if (full_message == last_message):                 need_process = True                 continue # \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \"\u044d\u0445\u043e\" # process messages. Send echo             if need_process: # \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u0430\u043c\u0438 # block a response for any pictures                 if (messageIsPicture in message):  ## smile                     message = messageWarrningAboutPicture                 self.sendMessage(\"Echo: \" + message) # \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c JavaSctipt # Disable   JavaSctipt                 self.driver.execute_cdp_cmd(commandEnableOrDisableJavaScript, {'value': True}) # \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 # write last processed message to file         if not (author_datetime is None):             f = open(fileNameWithLastMessage, \"w\")             f.write(full_message)             f.close() # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c JavaSctipt # Enable    JavaSctipt         self.driver.execute_cdp_cmd(commandEnableOrDisableJavaScript, {'value': False})   def main(args): # \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \u041f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u0435\u0433\u043e - Ctrl+C # the main infinite loop. interrupt it with Ctrl+C     try:         while True:             wa = whatapp()             wa.startBrowser()             wa.searchGroup(args.group)             dt = datetime.now()             wa.searchLastMessageAndProcessMessages(dt);             wa.finish()     except KeyboardInterrupt:         wa.finish()     return   if __name__ == '__main__': # \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 # we are parsing command line parameters     parser = argparse.ArgumentParser(description='Process messages by Whatsapp')     parser.add_argument('--group', help='Text for send', required=True)     args = parser.parse_args() # \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 # start  processing     main(args)     <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0431\u043e\u0442\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/p>\n<pre><code>python whatsapp.py --group \"\u0422\u0435\u0441\u0442\"<\/code><\/pre>\n<p>\u0412\u0441\u0435\u043c \u0443\u0434\u0430\u0447\u0438!  <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \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\/articles\/744774\/\"> https:\/\/habr.com\/ru\/articles\/744774\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a \u0432\u0441\u0435\u043c!<\/p>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 \u0438\u0437\u0433\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0434 Web \u0432\u0435\u0440\u0441\u0438\u0435\u0439 Whatsapp \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c-\u0431\u043e\u0442\u0430. \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 python c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438, \u043e\u043d\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043c\u043e\u0435\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/737990\/\" rel=\"noopener noreferrer nofollow\"><u>\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/u><\/a>.  <\/p>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u043e\u043c\u044f\u043d\u0443, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0431\u043e\u0442\u0435 (\u0435\u0433\u043e \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0436\u0435) \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 autoit, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0443 \u0441\u0443\u0442\u044c \u0437\u0430\u0434\u0443\u043c\u043a\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, docker-\u043e\u0431\u0440\u0430\u0437 &amp; etc). \u041d\u0430 \u043d\u0451\u043c \u0432 \u0446\u0438\u043a\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u043e\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443, \u0433\u0434\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u043e\u0442\u0430, \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0414\u0430\u043d\u043d\u044b\u0439 \u0440\u043e\u0431\u043e\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0443\u043c\u043d\u043e\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0430\u0434, \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c &#171;Echo:&#187;. \u041d\u043e \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430, \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e &#171;\u043e\u0442\u0432\u0435\u0442\u0447\u0438\u043a\u0430&#187;.<\/p>\n<p>\u0410 \u0441\u0435\u0439\u0447\u0430\u0441, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0431\u043e\u0442\u0430. \u041e\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u043a\u043b\u0430\u0441\u0441\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f whatapp(). \u0412 \u043d\u0451\u043c \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<\/p>\n<ul>\n<li>\n<p>startBrowser &#8212; \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>finish &#8212; \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440;<\/p>\n<\/li>\n<li>\n<p>searchGroup &#8212; \u0438\u0449\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>sendMessage &#8212; \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u0438\u043b\u0438 \u0432 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>searchLastMessageAndProcessMessages &#8212; \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f  \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u043e\u0432\u044b\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443 \u0432\u0441\u0442\u0440\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0431\u043e\u0442\u0430. \u041f\u0435\u0440\u0432\u043e\u0435,  \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0443\u0436\u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 JavaScript, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0441\u044f DOM, \u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c JavaScript. \u0412\u0442\u043e\u0440\u043e\u0435, \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043c\u0430\u0440\u043a\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e \u0435\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u0437\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0431\u043e\u0442\u0430. \u0422\u0440\u0435\u0442\u044c\u0435, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u0438, \u0442\u0430\u043a \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0435\u0449\u0435 \u043a\u0430\u043a-\u0442\u043e  \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.  <\/p>\n<p>\u0418 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443, \u0433\u0434\u0435 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f  \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041b\u0443\u0447\u0448\u0435 \u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0432\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u043c\u0443, \u043d\u043e \u044f, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043d\u0435 \u0441\u0442\u0430\u043b \u0437\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u043e\u0442\u0430.<\/p>\n<p>\u041f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443, \u0447\u0442\u043e \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u043e \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u0432\u043e\u0440\u0438\u0442\u043e\u043c \u0441\u0440\u0435\u0434\u0438 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Whatsapp, \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p> \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0435\u043a\u0441\u0442 \u0431\u043e\u0442\u0430. \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u043e \u0445\u043e\u0434\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043d\u0430 \u0434\u0432\u0443\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. <\/p>\n<pre><code class=\"python\">from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.support.ui import WebDriverWait from time import sleep import argparse from datetime import datetime   # \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f Selenium # Constants for Selenium url = f\"https:\/\/web.whatsapp.com\/\" xpath = \"\/\/button[@data-testid='compose-btn-send']\" xpathAttach = \"\/\/div[@data-testid='conversation-clip']\" cssIdOfDocument = \"[aria-label='\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442']\" cssIdOfSendButton = \"[aria-label='\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c']\" xpathSearchField = \"\/\/div[@data-testid='chat-list-search']\" xpathFoundItem = \"\/\/span[contains(@class,'matched-text')]\" xpathInputLineForText = \"\/\/div[@data-testid='conversation-compose-box-input']\" xpathMessage = \"\/\/div[@role = 'row']\" xpathAuthorTime = \"span[contains(@class,'_3FuDI')]\" xpathText1 = \"span[contains(@class,'selectable-text')]\" xpathText2 = \"span[contains(@class,'copyable-text')]\"  commandEnableOrDisableJavaScript = \"Emulation.setScriptExecutionDisabled\"  # \u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 # Constants for message process messageIsOutgoing = \"message-out\" messageIsText = \"data-pre-plain-text\" messageClassOfBody = \"selectable-text copyable-text\" messageBodyStart = \"&lt;span>\" messageBodyStop = \"&lt;\/span>\" messageIsPicture = \"img\" messageWarrningAboutPicture = \"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e!  I don't process emoticons !\" fileNameWithLastMessage = \"lastmessage.txt\"  class whatapp():     \"\"\" \u042d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u0431\u043e\u0442\u0430 \u0434\u043b\u044f Whatsapp        This class is bot for Whatsapp\"\"\"       def startBrowser(self):         options = webdriver.ChromeOptions() # \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 FireFox, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u043c options = webdriver.FirefoxOptions() . # if you have the Mozilla Fifefox just write                   options = webdriver.FirefoxOptions()         options.add_argument('--allow-profiles-outside-user-dir')         options.add_argument('--enable-profile-shortcut-manager') # \u0423\u041a\u0410\u0416\u0418\u0422\u0415 \u041f\u0423\u0422\u042c \u0413\u0414\u0415 \u041b\u0415\u0416\u0418\u0422 \u0412\u0410\u0428 python \u0424\u0410\u0419\u041b. \u0421\u043e\u0432\u0435\u0442\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u043d\u0435\u0433\u043e # Specify the path to where your python file is located. I suggest you create a separate folder for it         options.add_argument(r'user-data-dir=X:\\\\YYYYYY\\\\ZZZZZZ\\\\')         options.add_argument('--profile-directory=Profile 1')         options.add_argument('--profiling-flush=n')         options.add_argument('--enable-aggressive-domstorage-flushing')  # \u044d\u0442\u0438 \u043e\u043f\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445  SSL, \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0438 \u0442.\u043f. \u041d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f :( # these options need to disabled any messages about bad ssl, certification &amp; etc         options.add_argument('--ignore-certificate-errors-spki-list')         options.add_argument('--ignore-certificate-errors')         options.add_argument('--ignore-ssl-errors')         options.add_argument('log-level=3') # INFO = 0, # WARNING = 1, # LOG_ERROR = 2, # LOG_FATAL = 3. # default is 0. # \u041c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440 # We are starting a browser         self.driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options) # \u0436\u0434\u0451\u043c \u0435\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 # it takes some time to load it         wait = WebDriverWait(self.driver, 30) # \u0438\u0434\u0451\u043c \u0442\u0443\u0434\u0430 # go to there         self.driver.get(url) # \u0436\u0434\u0451\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b Whatsapp # we are waiting for Whatsapp page to load         wait.until(EC.element_to_be_clickable((By.XPATH, xpathSearchField)))       def finish(self): # \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0432\u0441\u0435 # close all         self.driver.quit()      def searchGroup(self, group_name): # \u041d\u0430\u0439\u0442\u0438 \u0433\u0440\u0443\u043f\u043f\u0443 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 # \u0412 \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \"\u0418\u0441\u043a\u0430\u0442\u044c\" # Find a group to process # In the search field, enter the name of the group and click \"Search\".         self.driver.find_element(By.XPATH, xpathSearchField).send_keys(group_name)         self.driver.find_element(By.XPATH, xpathFoundItem).click()         sleep(5)       def sendMessage(self, message): # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c JavaSctipt # Enable JavaSctipt         self.driver.execute_cdp_cmd(commandEnableOrDisableJavaScript, {'value': False}) # \u0418\u0449\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0443\u0434\u0430 \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # Find the input line and send the message text there         self.driver.find_element(By.XPATH, xpathInputLineForText).send_keys(message) # \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0449\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c\" \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043d\u0435\u0435 # now we look for the Send Button and click on it         self.driver.find_element(By.XPATH, xpath).click()         sleep(5)       def searchLastMessageAndProcessMessages(self, dt): # \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c JavaSctipt # Disable   JavaSctipt         self.driver.execute_cdp_cmd(commandEnableOrDisableJavaScript, {'value': True}) # \u0412\u044b\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # Select all messages         messages = self.driver.find_elements(By.XPATH, xpathMessage)         print(str(dt) + '. I found %s messages' % len(messages)) # \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 # Get the last processed message from file         f = open(fileNameWithLastMessage, \"r\")         last_message = f.read()         f.close()         need_process = False # \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # review all messages         for item in messages: # \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # get body of the message             line = str(item.get_attribute('innerHTML')) # \u044d\u0442\u043e \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c # this is outgoing message... skip it             if (messageIsOutgoing in line):                  continue # \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043d\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430. \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c # this message without text... skip it             if not (messageIsText in line):                  continue # \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043c \u0434\u0430\u0442\u0443, \u0432\u0440\u0435\u043c\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # extract date, time and author from the message             index1 = line.index(messageIsText)             index2 = line.index(\"]\", index1 + len(messageIsText))             index3 = line.index(\":\", index2)             author_datetime = line[index1 + len(messageIsText) + 2 : index3] # \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f # extract text from the message             index1 = line.index(messageClassOfBody)             index2 = line.index(messageBodyStart, index1 + len(messageClassOfBody))             index3 = line.index(messageBodyStop, index2)             message = line[index2 + len(messageBodyStart): index3] # \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u043c # create a complete message for comparison with the last processed message             full_message = author_datetime + \" \" + message # \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435, \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0432 \u044d\u0442\u043e # if the message was last processed, we start processing by skipping this             if (full_message == last_message):                 need_process = True                 continue # \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u041f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \"\u044d\u0445\u043e\" # process messages. Send echo             if need_process: # \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u043c\u0430\u0439\u043b\u0438\u043a\u0430\u043c\u0438 # block a response <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-349572","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349572","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=349572"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349572\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}