{"id":1178204,"date":"2025-01-15T18:07:53","date_gmt":"2025-01-15T10:07:53","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1178204.html"},"modified":"2025-01-15T18:07:56","modified_gmt":"2025-01-15T10:07:56","slug":"python%e5%a6%82%e4%bd%95%e7%94%9f%e6%88%90html%e6%b5%8b%e8%af%95%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1178204.html","title":{"rendered":"python\u5982\u4f55\u751f\u6210html\u6d4b\u8bd5\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25112935\/d9e6b88a-1ec1-40ca-b031-2c64212995d5.webp\" alt=\"python\u5982\u4f55\u751f\u6210html\u6d4b\u8bd5\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u751f\u6210HTML\u6d4b\u8bd5\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u591a\u79cd<\/strong>\uff0c\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u51fd\u6570\u3001\u7b2c\u4e09\u65b9\u5e93\u5982Jinja2\u3001BeautifulSoup\u7b49\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\uff1a<strong>\u4f7f\u7528\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u51fd\u6570<\/strong>\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u4f7f\u7528\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u51fd\u6570\u751f\u6210HTML\u6587\u4ef6<\/h2>\n<\/p>\n<p><h3>1\u3001\u521b\u5efa\u548c\u5199\u5165\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u6587\u4ef6\u64cd\u4f5c\u51fd\u6570\uff0c\u53ef\u4ee5\u7528\u6765\u521b\u5efa\u548c\u5199\u5165HTML\u6587\u4ef6\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2aHTML\u6587\u4ef6\uff0c\u5e76\u5c06HTML\u5185\u5bb9\u5199\u5165\u5176\u4e2d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6307\u5b9a\u6587\u4ef6\u540d<\/p>\n<p>file_name = &quot;test.html&quot;<\/p>\n<h2><strong>HTML\u5185\u5bb9<\/strong><\/h2>\n<p>html_content = &quot;&quot;&quot;<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<\/p>\n<p>    &lt;title&gt;Test HTML File&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;h1&gt;Welcome to the Test HTML File&lt;\/h1&gt;<\/p>\n<p>    &lt;p&gt;This is a paragraph.&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(file_name, &quot;w&quot;) as file:<\/p>\n<p>    file.write(html_content)<\/p>\n<p>print(f&quot;HTML file &#39;{file_name}&#39; has been created.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u4f7f\u7528\u53d8\u91cf\u52a8\u6001\u751f\u6210\u5185\u5bb9<\/h3>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u529f\u80fd\uff0c\u5c06\u53d8\u91cf\u503c\u63d2\u5165\u5230HTML\u5185\u5bb9\u4e2d\uff0c\u4ece\u800c\u751f\u6210\u52a8\u6001\u7684HTML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6307\u5b9a\u6587\u4ef6\u540d<\/p>\n<p>file_name = &quot;dynamic_test.html&quot;<\/p>\n<h2><strong>\u52a8\u6001\u5185\u5bb9<\/strong><\/h2>\n<p>title = &quot;Dynamic Test HTML File&quot;<\/p>\n<p>heading = &quot;Welcome to the Dynamic Test HTML File&quot;<\/p>\n<p>paragraph = &quot;This is a dynamically generated paragraph.&quot;<\/p>\n<h2><strong>HTML\u5185\u5bb9\u6a21\u677f<\/strong><\/h2>\n<p>html_template = &quot;&quot;&quot;<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<\/p>\n<p>    &lt;title&gt;{title}&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;h1&gt;{heading}&lt;\/h1&gt;<\/p>\n<p>    &lt;p&gt;{paragraph}&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<h2><strong>\u4f7f\u7528\u6a21\u677f\u751f\u6210HTML\u5185\u5bb9<\/strong><\/h2>\n<p>html_content = html_template.format(title=title, heading=heading, paragraph=paragraph)<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(file_name, &quot;w&quot;) as file:<\/p>\n<p>    file.write(html_content)<\/p>\n<p>print(f&quot;HTML file &#39;{file_name}&#39; has been created with dynamic content.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528Jinja2\u751f\u6210HTML\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>Jinja2\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6a21\u677f\u5f15\u64ce\uff0c\u53ef\u4ee5\u7528\u6765\u751f\u6210\u590d\u6742\u7684HTML\u6587\u4ef6\u3002\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6a21\u677f\u8bed\u6cd5\uff0c\u652f\u6301\u6761\u4ef6\u5224\u65ad\u3001\u5faa\u73af\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><h3>1\u3001\u5b89\u88c5Jinja2<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5Jinja2\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install Jinja2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u521b\u5efaJinja2\u6a21\u677f\u5e76\u6e32\u67d3<\/h3>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2aJinja2\u6a21\u677f\uff0c\u5e76\u4f7f\u7528\u53d8\u91cf\u6e32\u67d3\u751f\u6210HTML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from jinja2 import Template<\/p>\n<h2><strong>\u6307\u5b9a\u6587\u4ef6\u540d<\/strong><\/h2>\n<p>file_name = &quot;jinja2_test.html&quot;<\/p>\n<h2><strong>\u52a8\u6001\u5185\u5bb9<\/strong><\/h2>\n<p>title = &quot;Jinja2 Test HTML File&quot;<\/p>\n<p>heading = &quot;Welcome to the Jinja2 Test HTML File&quot;<\/p>\n<p>paragraph = &quot;This is a paragraph generated using Jinja2.&quot;<\/p>\n<h2><strong>Jinja2\u6a21\u677f<\/strong><\/h2>\n<p>template = Template(&quot;&quot;&quot;<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<\/p>\n<p>    &lt;title&gt;{{ title }}&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;h1&gt;{{ heading }}&lt;\/h1&gt;<\/p>\n<p>    &lt;p&gt;{{ paragraph }}&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&quot;&quot;&quot;)<\/p>\n<h2><strong>\u6e32\u67d3\u6a21\u677f\u751f\u6210HTML\u5185\u5bb9<\/strong><\/h2>\n<p>html_content = template.render(title=title, heading=heading, paragraph=paragraph)<\/p>\n<h2><strong>\u521b\u5efa\u5e76\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(file_name, &quot;w&quot;) as file:<\/p>\n<p>    file.write(html_content)<\/p>\n<p>print(f&quot;HTML file &#39;{file_name}&#39; has been created using Jinja2.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e09\u3001\u4f7f\u7528BeautifulSoup\u751f\u6210\u548c\u4fee\u6539HTML\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>BeautifulSoup\u662f\u4e00\u4e2a\u7528\u4e8e\u89e3\u6790\u548c\u64cd\u4f5cHTML\u6587\u6863\u7684\u5e93\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528BeautifulSoup\u751f\u6210\u548c\u4fee\u6539HTML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h3>1\u3001\u5b89\u88c5BeautifulSoup<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5BeautifulSoup\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install beautifulsoup4<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2\u3001\u521b\u5efa\u548c\u4fee\u6539HTML\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528BeautifulSoup\u521b\u5efa\u548c\u4fee\u6539HTML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<h2><strong>\u6307\u5b9a\u6587\u4ef6\u540d<\/strong><\/h2>\n<p>file_name = &quot;beautifulsoup_test.html&quot;<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684HTML\u6587\u6863<\/strong><\/h2>\n<p>soup = BeautifulSoup(&quot;&lt;html&gt;&lt;\/html&gt;&quot;, &quot;html.parser&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u548c\u6dfb\u52a0\u5143\u7d20<\/strong><\/h2>\n<p>html = soup.html<\/p>\n<p>head = soup.new_tag(&quot;head&quot;)<\/p>\n<p>html.append(head)<\/p>\n<p>title = soup.new_tag(&quot;title&quot;)<\/p>\n<p>title.string = &quot;BeautifulSoup Test HTML File&quot;<\/p>\n<p>head.append(title)<\/p>\n<p>body = soup.new_tag(&quot;body&quot;)<\/p>\n<p>html.append(body)<\/p>\n<p>h1 = soup.new_tag(&quot;h1&quot;)<\/p>\n<p>h1.string = &quot;Welcome to the BeautifulSoup Test HTML File&quot;<\/p>\n<p>body.append(h1)<\/p>\n<p>p = soup.new_tag(&quot;p&quot;)<\/p>\n<p>p.string = &quot;This is a paragraph generated using BeautifulSoup.&quot;<\/p>\n<p>body.append(p)<\/p>\n<h2><strong>\u5c06\u751f\u6210\u7684HTML\u5199\u5165\u6587\u4ef6<\/strong><\/h2>\n<p>with open(file_name, &quot;w&quot;) as file:<\/p>\n<p>    file.write(soup.prettify())<\/p>\n<p>print(f&quot;HTML file &#39;{file_name}&#39; has been created using BeautifulSoup.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u56db\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u4f7f\u7528Python\u751f\u6210HTML\u6d4b\u8bd5\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u51fd\u6570\u3001Jinja2\u6a21\u677f\u5f15\u64ce\u548cBeautifulSoup\u5e93\u7b49\u3002<strong>\u4f7f\u7528\u5185\u7f6e\u6587\u4ef6\u64cd\u4f5c\u51fd\u6570\u7b80\u5355\u76f4\u63a5\uff0c\u9002\u5408\u751f\u6210\u57fa\u672c\u7684HTML\u6587\u4ef6\uff0c\u4f7f\u7528Jinja2\u6a21\u677f\u5f15\u64ce\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u751f\u6210\u590d\u6742\u7684\u52a8\u6001HTML\u6587\u4ef6\uff0c\u800cBeautifulSoup\u5e93\u5219\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u89e3\u6790\u548c\u64cd\u4f5c\u529f\u80fd\uff0c\u9002\u5408\u9700\u8981\u5bf9HTML\u6587\u4ef6\u8fdb\u884c\u590d\u6742\u4fee\u6539\u7684\u573a\u666f<\/strong>\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u9ad8\u6548\u5730\u751f\u6210\u6240\u9700\u7684HTML\u6587\u4ef6\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Python\u4e2d\u751f\u6210HTML\u6d4b\u8bd5\u6587\u4ef6\u7684\u57fa\u672c\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u751f\u6210HTML\u6d4b\u8bd5\u6587\u4ef6\uff0c\u60a8\u9700\u8981\u4f7f\u7528\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd\u3002\u9996\u5148\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684HTML\u6587\u4ef6\u5e76\u4f7f\u7528<code>open()<\/code>\u51fd\u6570\u4ee5\u5199\u5165\u6a21\u5f0f\u6253\u5f00\u5b83\u3002\u63a5\u4e0b\u6765\uff0c\u60a8\u53ef\u4ee5\u5c06HTML\u5185\u5bb9\u5199\u5165\u6587\u4ef6\uff0c\u4f8b\u5982\u57fa\u672c\u7684HTML\u7ed3\u6784\u3001\u6807\u9898\u548c\u6bb5\u843d\u3002\u5b8c\u6210\u540e\uff0c\u786e\u4fdd\u8c03\u7528<code>close()<\/code>\u65b9\u6cd5\u4ee5\u4fdd\u5b58\u6587\u4ef6\u5e76\u5173\u95ed\u5b83\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9bPython\u5e93\u53ef\u4ee5\u7b80\u5316HTML\u6587\u4ef6\u7684\u751f\u6210\u8fc7\u7a0b\uff1f<\/strong><br \/>\u6709\u51e0\u4e2a\u6d41\u884c\u7684Python\u5e93\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u8f7b\u677e\u5730\u751f\u6210HTML\u6587\u4ef6\u3002\u4f8b\u5982\uff0c<code>Jinja2<\/code>\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6a21\u677f\u5f15\u64ce\uff0c\u53ef\u4ee5\u8ba9\u60a8\u5728HTML\u6587\u4ef6\u4e2d\u4f7f\u7528\u53d8\u91cf\u548c\u63a7\u5236\u7ed3\u6784\u3002<code>BeautifulSoup<\/code>\u4e5f\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u548c\u4fee\u6539HTML\u6587\u6863\u7684\u7ed3\u6784\uff0c\u867d\u7136\u5b83\u901a\u5e38\u7528\u4e8e\u89e3\u6790\u800c\u4e0d\u662f\u751f\u6210\uff0c\u4f46\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u7f16\u7a0b\u65b9\u5f0f\u6765\u6784\u5efaHTML\u3002<\/p>\n<p><strong>\u5982\u4f55\u786e\u4fdd\u751f\u6210\u7684HTML\u6587\u4ef6\u5728\u4e0d\u540c\u6d4f\u89c8\u5668\u4e2d\u517c\u5bb9\uff1f<\/strong><br \/>\u4e3a\u4e86\u786e\u4fdd\u751f\u6210\u7684HTML\u6587\u4ef6\u5728\u5404\u5927\u6d4f\u89c8\u5668\u4e2d\u90fd\u80fd\u517c\u5bb9\uff0c\u9075\u5faaHTML\u6807\u51c6\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4f7f\u7528\u6709\u6548\u7684HTML\u6807\u7b7e\u548c\u7ed3\u6784\uff0c\u907f\u514d\u4f7f\u7528\u8fc7\u65f6\u7684\u6216\u4e0d\u652f\u6301\u7684\u7279\u6027\u3002\u6b64\u5916\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>W3C Validator<\/code>\u7b49\u5de5\u5177\u6765\u9a8c\u8bc1\u60a8\u7684HTML\u4ee3\u7801\u662f\u5426\u7b26\u5408\u6807\u51c6\uff0c\u5e76\u6839\u636e\u53cd\u9988\u8fdb\u884c\u76f8\u5e94\u7684\u4fee\u6539\u3002\u4f7f\u7528CSS\u548cJavaScript\u65f6\uff0c\u786e\u4fdd\u4f7f\u7528\u517c\u5bb9\u7684\u8bed\u6cd5\u548c\u529f\u80fd\uff0c\u63d0\u4f9b\u5fc5\u8981\u7684\u964d\u7ea7\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u751f\u6210HTML\u6d4b\u8bd5\u6587\u4ef6\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u7684\u6587\u4ef6\u64cd\u4f5c\u51fd\u6570\u3001\u7b2c\u4e09\u65b9\u5e93\u5982Jinja2\u3001Beau [&hellip;]","protected":false},"author":3,"featured_media":1178209,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1178204"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1178204"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1178204\/revisions"}],"predecessor-version":[{"id":1178211,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1178204\/revisions\/1178211"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1178209"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1178204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1178204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1178204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}