{"id":331568,"date":"2022-04-06T09:00:40","date_gmt":"2022-04-06T09:00:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=331568"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=331568","title":{"rendered":"<span>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0421onfluence API<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c16\/355\/0d7\/c163550d7b0bb815b32c95774f960435.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c16\/355\/0d7\/c163550d7b0bb815b32c95774f960435.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043a\u0435\u0439\u0441\u043e\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0421onfluence.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Confluence \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u0441\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\/\u0441\u0430\u0439\u0442, \u0433\u0434\u0435 \u0432\u044b \u043a\u043e\u043f\u0438\u0442\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0432\u0430\u0448\u0435\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0434\u0435\u0442\u0435 \u0441\u0432\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u0432 Confluence, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0432\u044b\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0441\u043c\u043e\u0433 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 \u043d\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u00ab\u0444\u0438\u0448\u043a\u0438\u00bb, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0445 \u043e\u043f\u043b\u0430\u0442\u0438\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 Neoflex \u0438\u0437 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f Big Data Solutions \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f:<\/p>\n<p>\u041f\u0440\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432 Confluence \u0441\u0442\u0430\u0440\u0430\u0435\u0448\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430), \u0430 \u0432\u043e\u0442 \u0437\u0430\u0431\u0440\u0430\u0442\u044c\/\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 Word \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u0432 \u043e\u0434\u0438\u043d \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0417\u043d\u0430\u044f \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u043a Selenium \u0438 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Python, \u043c\u043d\u043e\u044e \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u0430 \u043f\u043e \u0432\u0441\u0435\u043c \u0435\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c. \u0412 \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 id \u0432 url, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430, \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u0442.\u0434. \u0412\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0442\u0440\u043e\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435: \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 \u0442\u0435\u0433\u0430\u0445 \u0432 html \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 DOCX. \u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<ol>\n<li>\n<p>\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b. Selenium \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0433\u0438. \u00a0\u041e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 sleep() \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0430\u0441\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e Confluence. \u041e\u043d \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b (\u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440); <\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 (\u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0433\u0434\u0435 \u0431\u044b\u043b\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043d\u0430\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0432 \u0421onfluence);<\/p>\n<\/li>\n<li>\n<p>\u0418 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0438 \u043d\u0430\u0448\u0435\u043b Confluence API. \u042d\u0442\u043e \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u043e \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0412\u0441\u0435, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u2013 \u044d\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430. <\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 atlassian-python-api \u0438 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c API.<\/p>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e API \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043f\u0430\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 (\u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/atlassian-python-api.readthedocs.io\/confluence.html\"><u>\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441<\/u><\/a>).<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434: <\/p>\n<pre><code class=\"python\">from atlassian import Confluence url='https:\/\/confluence.ru\/'#\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. username='\u0442\u0432\u043e\u0439_\u043b\u043e\u0433\u0438\u043d' password='\u0442\u0432\u043e\u0439_\u043f\u0430\u0440\u043e\u043b\u044c'  confluence = Confluence( \u00a0\u00a0\u00a0 url=url, \u00a0\u00a0\u00a0 username=username, \u00a0\u00a0\u00a0 password=password)<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b. <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435: <\/p>\n<pre><code class=\"python\">from atlassian import Confluence def get_id(url_full): \u00a0\u00a0\u00a0 return url_full.split('=')[-1]  def get_child(id): \u00a0\u00a0\u00a0 t = confluence.cql(cql='parent={0}'.format(id), start=0, limit=None, expand=None,include_archived_spaces=None, excerpt=None)['results'] \u00a0\u00a0\u00a0 return sort_json(t) \u00a0 def cursor(list_child,level=0): \u00a0\u00a0\u00a0 for i in list_child: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 id = i['content']['id'] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if len(get_child(id))>0: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 page = confluence.get_page_by_id(page_id=id) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = confluence.get_page_as_word(page['id']) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 contents.append(response) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0#\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0441\u043d\u043e\u0432\u0430 \u0432 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cursor(get_child(id),level=level+1) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 page = confluence.get_page_by_id(page_id=id) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = confluence.get_page_as_word(page['id']) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 contents.append(response) \u00a0 def start_parser(url,url_full): \u00a0\u00a0\u00a0 #\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 ID \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u00a0\u00a0\u00a0 id_url = get_id(url_full) \u00a0\u00a0\u00a0 #\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u00a0\u00a0\u00a0 page = confluence.get_page_by_id(page_id=id_url) \u00a0\u00a0\u00a0 #\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432\u043e\u0440\u0434\u043e\u0432\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b(\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b) \u00a0\u00a0\u00a0 response = confluence.get_page_as_word(page['id']) \u00a0\u00a0\u00a0 contents.append(response) \u00a0\u00a0\u00a0 #\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u00a0\u00a0\u00a0 list_child = get_child(id_url) \u00a0\u00a0\u00a0 #\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0435\u043a\u0443\u043d\u0441\u0438\u044e \u00a0\u00a0\u00a0 cursor(list_child) \u00a0\u00a0\u00a0 return page['title'] \u00a0 def save_files(contents): \u00a0\u00a0\u00a0 for i,j in enumerate(contents): \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 with open(f'{i}.doc', mode='wb') as file_pdf: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 file_pdf.write(j) \u00a0 def sort_json(json_list): \u00a0\u00a0\u00a0 titles = list() \u00a0\u00a0\u00a0 for i in json_list: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 titles.append(i['title']) \u00a0\u00a0\u00a0 titles.sort() \u00a0\u00a0\u00a0 sort_json = list() \u00a0\u00a0\u00a0 for i in titles: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for j in json_list: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if i==j['title']: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sort_json.append(j) \u00a0\u00a0\u00a0 return sort_json \u00a0 url='https:\/\/confluence.ru\/' url_full='https:\/\/confluence\/pages\/viewpage.action?pageId=*******' \u00a0 confluence = Confluence( \u00a0\u00a0\u00a0 url=url, \u00a0\u00a0 \u00a0username='\u0442\u0432\u043e\u0439_\u043b\u043e\u0433\u0438\u043d', \u00a0\u00a0\u00a0 password='\u0442\u0432\u043e\u0439_\u043f\u0430\u0440\u043e\u043b\u044c') \u00a0 contents = list() #\u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 global_title = start_parser(url,url_full) #\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 doc \u0444\u0430\u0439\u043b\u044b save_files(contents)<\/code><\/pre>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043d\u0430\u0441 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0444\u0430\u0439\u043b\u044b DOC, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 DOCX. \u0421 \u044d\u0442\u0438\u043c \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 win32com. <\/p>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0444\u0430\u0439\u043b\u0430\u043c DOC:<\/p>\n<pre><code class=\"python\">def convert_doc_to_docx(files): \u00a0\u00a0\u00a0 for path in files: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 word = win32.gencache.EnsureDispatch('Word.Application') \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc = word.Documents.Open(path) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc.Activate() \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0432 docx. \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 new_file_abs = os.path.abspath(path) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 new_file_abs = re.sub(r'\\.\\w+$', '.docx', new_file_abs) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 word.ActiveDocument.SaveAs( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 new_file_abs, FileFormat=constants.wdFormatXMLDocument \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc.Close(False) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 os.remove(path)<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 python-docx, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0441\u0442\u0438\u043b\u0435\u0439.<\/p>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432<\/p>\n<pre><code class=\"python\">def composer(files): \u00a0\u00a0\u00a0 master = Document('qwe.docx') \u00a0\u00a0\u00a0 composer = Composer(master) \u00a0\u00a0\u00a0 for file in files: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc2 = Document(file) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if file != files[-1]: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc2.add_page_break() \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 composer.append(doc2) \u00a0\u00a0\u00a0 composer.save(f\"{global_title}.docx\")<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: <\/p>\n<ul>\n<li>\n<p><code>master = Document('qwe.docx')<\/code> \u2013 \u044d\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u043c\u043d\u043e\u044e \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u043e \u0441\u0442\u0438\u043b\u044f\u043c\u0438, \u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0421\u044e\u0434\u0430 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u00ab\u0434\u0435\u0440\u0433\u0430\u0442\u044c\u00bb \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446;<\/p>\n<\/li>\n<li>\n<p><code>composer = Composer(master)<\/code> \u2013 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c master \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0430\u0439\u043b\u044b docx;<\/p>\n<\/li>\n<li>\n<p><code>doc2.add_page_break()<\/code> \u2013 \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u00ab\u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\u00bb, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439;<\/p>\n<\/li>\n<li>\n<p><code>composer.append(doc2)<\/code> \u2013 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 doc2 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b;<\/p>\n<\/li>\n<li>\n<p><code>composer.save (f\"{global_title}.docx\")<\/code> \u2013 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0431\u043e\u0440\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0444\u0430\u0439\u043b DOCX \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u043f\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 Confluence. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0441\u0442\u0438\u043b\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 Word.<\/p>\n<p>\u041f\u043e\u0434\u0432\u043e\u0434\u044f \u0438\u0442\u043e\u0433\u0438, \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 API \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 python-docx \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u0434\u0438\u043d \u2013 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0438 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0434 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0432\u044b\u043b\u043e\u0436\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/lexanze3\/confluenceApi\">github<\/a>\u00a0<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/company\/neoflex\/blog\/659319\/\"> https:\/\/habr.com\/ru\/company\/neoflex\/blog\/659319\/<\/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_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043a\u0435\u0439\u0441\u043e\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0421onfluence.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Confluence \u0438 \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u0441\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\/\u0441\u0430\u0439\u0442, \u0433\u0434\u0435 \u0432\u044b \u043a\u043e\u043f\u0438\u0442\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0432\u0430\u0448\u0435\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0434\u0435\u0442\u0435 \u0441\u0432\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u0432 Confluence, \u0447\u0442\u043e\u0431\u044b \u043d\u043e\u0432\u044b\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0441\u043c\u043e\u0433 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 \u043d\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438, \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u00ab\u0444\u0438\u0448\u043a\u0438\u00bb, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0445 \u043e\u043f\u043b\u0430\u0442\u0438\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>\u0421\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 Neoflex \u0438\u0437 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f Big Data Solutions \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f:<\/p>\n<p>\u041f\u0440\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432 Confluence \u0441\u0442\u0430\u0440\u0430\u0435\u0448\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430), \u0430 \u0432\u043e\u0442 \u0437\u0430\u0431\u0440\u0430\u0442\u044c\/\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 Word \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0443\u043a\u0430\u043c\u0438 \u0432 \u043e\u0434\u0438\u043d \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043b \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0417\u043d\u0430\u044f \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u043a Selenium \u0438 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Python, \u043c\u043d\u043e\u044e \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u0430 \u043f\u043e \u0432\u0441\u0435\u043c \u0435\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c. \u0412 \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 id \u0432 url, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430, \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u0442.\u0434. \u0412\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u0442\u0440\u043e\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435: \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 \u0442\u0435\u0433\u0430\u0445 \u0432 html \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 DOCX. \u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<ol>\n<li>\n<p>\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b. Selenium \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0433\u0438. \u00a0\u041e\u0431\u044b\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 sleep() \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0430\u0441\u044c;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e Confluence. \u041e\u043d \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b (\u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440); <\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446, \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 (\u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0433\u0434\u0435 \u0431\u044b\u043b\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043d\u0430\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0432 \u0421onfluence);<\/p>\n<\/li>\n<li>\n<p>\u0418 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2013 \u044d\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0438 \u043d\u0430\u0448\u0435\u043b Confluence API. \u042d\u0442\u043e \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u043e \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430. \u0412\u0441\u0435, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u2013 \u044d\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430. <\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 atlassian-python-api \u0438 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c API.<\/p>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e API \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043d\u043e \u043c\u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043f\u0430\u0440\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 (\u0434\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/atlassian-python-api.readthedocs.io\/confluence.html\"><u>\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441<\/u><\/a>).<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434: <\/p>\n<pre><code class=\"python\">from atlassian import Confluence url='https:\/\/confluence.ru\/'#\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. username='\u0442\u0432\u043e\u0439_\u043b\u043e\u0433\u0438\u043d' password='\u0442\u0432\u043e\u0439_\u043f\u0430\u0440\u043e\u043b\u044c'  confluence = Confluence( \u00a0\u00a0\u00a0 url=url, \u00a0\u00a0\u00a0 username=username, \u00a0\u00a0\u00a0 password=password)<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b. <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435: <\/p>\n<pre><code class=\"python\">from atlassian import Confluence def get_id(url_full): \u00a0\u00a0\u00a0 return url_full.split('=')[-1]  def get_child(id): \u00a0\u00a0\u00a0 t = confluence.cql(cql='parent={0}'.format(id), start=0, limit=None, expand=None,include_archived_spaces=None, excerpt=None)['results'] \u00a0\u00a0\u00a0 return sort_json(t) \u00a0 def cursor(list_child,level=0): \u00a0\u00a0\u00a0 for i in list_child: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 id = i['content']['id'] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if len(get_child(id))>0: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 page = confluence.get_page_by_id(page_id=id) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = confluence.get_page_as_word(page['id']) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 contents.append(response) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0#\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0441\u043d\u043e\u0432\u0430 \u0432 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cursor(get_child(id),level=level+1) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 page = confluence.get_page_by_id(page_id=id) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 response = confluence.get_page_as_word(page['id']) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 contents.append(response) \u00a0 def start_parser(url,url_full): \u00a0\u00a0\u00a0 #\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 ID \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u00a0\u00a0\u00a0 id_url = get_id(url_full) \u00a0\u00a0\u00a0 #\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u00a0\u00a0\u00a0 page = confluence.get_page_by_id(page_id=id_url) \u00a0\u00a0\u00a0 #\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432\u043e\u0440\u0434\u043e\u0432\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b(\u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b) \u00a0\u00a0\u00a0 response = confluence.get_page_as_word(page['id']) \u00a0\u00a0\u00a0 contents.append(response) \u00a0\u00a0\u00a0 #\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u00a0\u00a0\u00a0 list_child = get_child(id_url) \u00a0\u00a0\u00a0 #\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0435\u043a\u0443\u043d\u0441\u0438\u044e \u00a0\u00a0\u00a0 cursor(list_child) \u00a0\u00a0\u00a0 return page['title'] \u00a0 def save_files(contents): \u00a0\u00a0\u00a0 for i,j in enumerate(contents): \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 with open(f'{i}.doc', mode='wb') as file_pdf: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 file_pdf.write(j) \u00a0 def sort_json(json_list): \u00a0\u00a0\u00a0 titles = list() \u00a0\u00a0\u00a0 for i in json_list: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 titles.append(i['title']) \u00a0\u00a0\u00a0 titles.sort() \u00a0\u00a0\u00a0 sort_json = list() \u00a0\u00a0\u00a0 for i in titles: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for j in json_list: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if i==j['title']: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sort_json.append(j) \u00a0\u00a0\u00a0 return sort_json \u00a0 url='https:\/\/confluence.ru\/' url_full='https:\/\/confluence\/pages\/viewpage.action?pageId=*******' \u00a0 confluence = Confluence( \u00a0\u00a0\u00a0 url=url, \u00a0\u00a0 \u00a0username='\u0442\u0432\u043e\u0439_\u043b\u043e\u0433\u0438\u043d', \u00a0\u00a0\u00a0 password='\u0442\u0432\u043e\u0439_\u043f\u0430\u0440\u043e\u043b\u044c') \u00a0 contents = list() #\u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 global_title = start_parser(url,url_full) #\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 doc \u0444\u0430\u0439\u043b\u044b save_files(contents)<\/code><\/pre>\n<p>\u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043d\u0430\u0441 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0444\u0430\u0439\u043b\u044b DOC, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 DOCX. \u0421 \u044d\u0442\u0438\u043c \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 win32com. <\/p>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0442\u0435\u0439 \u043a \u0444\u0430\u0439\u043b\u0430\u043c DOC:<\/p>\n<pre><code class=\"python\">def convert_doc_to_docx(files): \u00a0\u00a0\u00a0 for path in files: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 word = win32.gencache.EnsureDispatch('Word.Application') \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc = word.Documents.Open(path) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc.Activate() \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u044b \u0432 docx. \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 new_file_abs = os.path.abspath(path) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 new_file_abs = re.sub(r'\\.\\w+$', '.docx', new_file_abs) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 word.ActiveDocument.SaveAs( \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 new_file_abs, FileFormat=constants.wdFormatXMLDocument \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc.Close(False) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 os.remove(path)<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 python-docx, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0441\u0442\u0438\u043b\u0435\u0439.<\/p>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432<\/p>\n<pre><code class=\"python\">def composer(files): \u00a0\u00a0\u00a0 master = Document('qwe.docx') \u00a0\u00a0\u00a0 composer = Composer(master) \u00a0\u00a0\u00a0 for file in files: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc2 = Document(file) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if file != files[-1]: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 doc2.add_page_break() \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 composer.append(doc2) \u00a0\u00a0\u00a0 composer.save(f\"{global_title}.docx\")<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: <\/p>\n<ul>\n<li>\n<p><code>master = Document('qwe.docx')<\/code> \u2013 \u044d\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u043c\u043d\u043e\u044e \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u043e \u0441\u0442\u0438\u043b\u044f\u043c\u0438, \u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0421\u044e\u0434\u0430 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u00ab\u0434\u0435\u0440\u0433\u0430\u0442\u044c\u00bb \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446;<\/p>\n<\/li>\n<li>\n<p><code>composer = Composer(master)<\/code> \u2013 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c master \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u0430\u0439\u043b\u044b docx;<\/p>\n<\/li>\n<li>\n<p><code>doc2.add_page_break()<\/code> \u2013 \u0434\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u00ab\u0440\u0430\u0437\u0440\u044b\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\u00bb, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439;<\/p>\n<\/li>\n<li>\n<p><code>composer.append(doc2)<\/code> \u2013 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 doc2 \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b;<\/p>\n<\/li>\n<li>\n<p><code>composer.save (f\"{global_title}.docx\")<\/code> \u2013 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441\u0431\u043e\u0440\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0444\u0430\u0439\u043b DOCX \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u043f\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 Confluence. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u0432\u0441\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0441\u0442\u0438\u043b\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 Word.<\/p>\n<p>\u041f\u043e\u0434\u0432\u043e\u0434\u044f \u0438\u0442\u043e\u0433\u0438, \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 API \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 python-docx \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u0434\u0438\u043d \u2013 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0438 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0434 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0432\u044b\u043b\u043e\u0436\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/lexanze3\/confluenceApi\">github<\/a>\u00a0<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/company\/neoflex\/blog\/659319\/\"> https:\/\/habr.com\/ru\/company\/neoflex\/blog\/659319\/<\/a><br \/><\/br><\/br><\/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-331568","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331568","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=331568"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331568\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}