{"id":1104440,"date":"2025-01-08T16:20:40","date_gmt":"2025-01-08T08:20:40","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1104440.html"},"modified":"2025-01-08T16:20:57","modified_gmt":"2025-01-08T08:20:57","slug":"python%e7%88%ac%e8%99%ab%e4%b8%8b%e6%9d%a5%e7%9a%84%e6%96%87%e5%ad%97%e5%a6%82%e4%bd%95%e5%86%99%e5%88%b0%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1104440.html","title":{"rendered":"python\u722c\u866b\u4e0b\u6765\u7684\u6587\u5b57\u5982\u4f55\u5199\u5230\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25065816\/df15f81d-c8ea-4810-b2cd-07646a5e5e31.webp\" alt=\"python\u722c\u866b\u4e0b\u6765\u7684\u6587\u5b57\u5982\u4f55\u5199\u5230\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>\u5728Python\u722c\u866b\u8fc7\u7a0b\u4e2d\uff0c\u5c06\u722c\u53d6\u4e0b\u6765\u7684\u6587\u5b57\u5199\u5165\u6587\u4ef6\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u4f7f\u7528requests\u5e93\u8fdb\u884c\u7f51\u9875\u8bf7\u6c42\u3001\u4f7f\u7528BeautifulSoup\u5e93\u89e3\u6790\u7f51\u9875\u5185\u5bb9\u3001\u63d0\u53d6\u6240\u9700\u6570\u636e\u5e76\u4f7f\u7528\u6587\u4ef6\u64cd\u4f5c\u5c06\u5176\u5199\u5165\u6587\u4ef6\u3002<\/strong> \u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6bcf\u4e2a\u6b65\u9aa4\uff0c\u5e76\u63d0\u4f9b\u76f8\u5173\u4ee3\u7801\u793a\u4f8b\u548c\u6ce8\u610f\u4e8b\u9879\u3002\u4e0b\u9762\u662f\u5177\u4f53\u7684\u65b9\u6cd5\u548c\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528requests\u5e93\u8fdb\u884c\u7f51\u9875\u8bf7\u6c42<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528requests\u5e93\u5411\u76ee\u6807\u7f51\u9875\u53d1\u9001\u8bf7\u6c42\uff0c\u83b7\u53d6\u7f51\u9875\u7684HTML\u5185\u5bb9\u3002requests\u5e93\u662f\u4e00\u4e2a\u7b80\u5355\u4e14\u529f\u80fd\u5f3a\u5927\u7684HTTP\u5e93\uff0c\u7528\u4e8e\u53d1\u9001\u6240\u6709\u7c7b\u578b\u7684HTTP\u8bf7\u6c42\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5requests\u5e93<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5requests\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u53d1\u9001\u8bf7\u6c42\u83b7\u53d6\u7f51\u9875\u5185\u5bb9<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528requests.get()\u65b9\u6cd5\u5411\u76ee\u6807URL\u53d1\u9001GET\u8bf7\u6c42\uff0c\u5e76\u83b7\u53d6\u54cd\u5e94\u5185\u5bb9\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>url = &#39;https:\/\/example.com&#39;<\/p>\n<p>response = requests.get(url)<\/p>\n<h2><strong>\u68c0\u67e5\u8bf7\u6c42\u662f\u5426\u6210\u529f<\/strong><\/h2>\n<p>if response.status_code == 200:<\/p>\n<p>    html_content = response.text<\/p>\n<p>else:<\/p>\n<p>    print(f&quot;F<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>led to retrieve content. Status code: {response.status_code}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528BeautifulSoup\u5e93\u89e3\u6790\u7f51\u9875\u5185\u5bb9<\/h3>\n<\/p>\n<p><p>\u83b7\u53d6\u7f51\u9875\u5185\u5bb9\u540e\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528BeautifulSoup\u5e93\u89e3\u6790HTML\u5185\u5bb9\uff0c\u4ee5\u4fbf\u63d0\u53d6\u6240\u9700\u7684\u6570\u636e\u3002BeautifulSoup\u662f\u4e00\u4e2a\u7528\u4e8e\u89e3\u6790HTML\u548cXML\u6587\u6863\u7684\u5e93\uff0c\u80fd\u591f\u8f7b\u677e\u5730\u63d0\u53d6\u6587\u6863\u4e2d\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5BeautifulSoup\u5e93<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5BeautifulSoup\u5e93\u53ca\u5176\u4f9d\u8d56\u5e93lxml\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install beautifulsoup4 lxml<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u89e3\u6790HTML\u5185\u5bb9\u5e76\u63d0\u53d6\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528BeautifulSoup\u89e3\u6790HTML\u5185\u5bb9\u5e76\u63d0\u53d6\u7279\u5b9a\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;lxml&#39;)<\/p>\n<h2><strong>\u5047\u8bbe\u6211\u4eec\u8981\u63d0\u53d6\u6240\u6709\u7684\u6bb5\u843d\u6587\u672c<\/strong><\/h2>\n<p>paragraphs = soup.find_all(&#39;p&#39;)<\/p>\n<p>texts = [para.get_text() for para in paragraphs]<\/p>\n<h2><strong>\u6253\u5370\u63d0\u53d6\u7684\u6587\u672c<\/strong><\/h2>\n<p>for text in texts:<\/p>\n<p>    print(text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5c06\u63d0\u53d6\u7684\u6587\u5b57\u5199\u5165\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u63d0\u53d6\u5230\u6240\u9700\u6570\u636e\u540e\uff0c\u6211\u4eec\u9700\u8981\u5c06\u8fd9\u4e9b\u6570\u636e\u5199\u5165\u6587\u4ef6\u3002Python\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6587\u4ef6\u64cd\u4f5c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5199\u5165\u6587\u672c\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u5c06\u63d0\u53d6\u5230\u7684\u6587\u5b57\u5199\u5165\u6587\u672c\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">file_path = &#39;output.txt&#39;<\/p>\n<p>with open(file_path, &#39;w&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    for text in texts:<\/p>\n<p>        file.write(text + &#39;\\n&#39;)<\/p>\n<p>print(f&quot;Data has been written to {file_path}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u5199\u5165CSV\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u9700\u8981\u5c06\u6570\u636e\u5199\u5165CSV\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684csv\u6a21\u5757\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import csv<\/p>\n<p>csv_file_path = &#39;output.csv&#39;<\/p>\n<p>with open(csv_file_path, &#39;w&#39;, encoding=&#39;utf-8&#39;, newline=&#39;&#39;) as file:<\/p>\n<p>    writer = csv.writer(file)<\/p>\n<p>    writer.writerow([&#39;Text&#39;])  # \u5199\u5165\u8868\u5934<\/p>\n<p>    for text in texts:<\/p>\n<p>        writer.writerow([text])<\/p>\n<p>print(f&quot;Data has been written to {csv_file_path}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406\u5f02\u5e38\u60c5\u51b5<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u5904\u7406\u5404\u79cd\u53ef\u80fd\u7684\u5f02\u5e38\u60c5\u51b5\uff0c\u4ee5\u786e\u4fdd\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u3002\u4f8b\u5982\uff0c\u5904\u7406\u7f51\u7edc\u8bf7\u6c42\u5931\u8d25\u3001HTML\u89e3\u6790\u9519\u8bef\u3001\u6587\u4ef6\u5199\u5165\u9519\u8bef\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5904\u7406\u7f51\u7edc\u8bf7\u6c42\u5931\u8d25<\/h4>\n<\/p>\n<p><p>\u5728\u53d1\u9001\u7f51\u7edc\u8bf7\u6c42\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528try-except\u8bed\u53e5\u6355\u83b7\u8bf7\u6c42\u5931\u8d25\u7684\u5f02\u5e38\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    response = requests.get(url)<\/p>\n<p>    response.raise_for_status()  # \u68c0\u67e5\u8bf7\u6c42\u662f\u5426\u6210\u529f<\/p>\n<p>except requests.exceptions.RequestException as e:<\/p>\n<p>    print(f&quot;Failed to retrieve content: {e}&quot;)<\/p>\n<p>    exit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u5904\u7406HTML\u89e3\u6790\u9519\u8bef<\/h4>\n<\/p>\n<p><p>\u5728\u89e3\u6790HTML\u5185\u5bb9\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528try-except\u8bed\u53e5\u6355\u83b7\u89e3\u6790\u9519\u8bef\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    soup = BeautifulSoup(html_content, &#39;lxml&#39;)<\/p>\n<p>except Exception as e:<\/p>\n<p>    print(f&quot;Failed to parse HTML content: {e}&quot;)<\/p>\n<p>    exit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u5904\u7406\u6587\u4ef6\u5199\u5165\u9519\u8bef<\/h4>\n<\/p>\n<p><p>\u5728\u5199\u5165\u6587\u4ef6\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528try-except\u8bed\u53e5\u6355\u83b7\u6587\u4ef6\u64cd\u4f5c\u9519\u8bef\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">try:<\/p>\n<p>    with open(file_path, &#39;w&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        for text in texts:<\/p>\n<p>            file.write(text + &#39;\\n&#39;)<\/p>\n<p>except IOError as e:<\/p>\n<p>    print(f&quot;Failed to write to file: {e}&quot;)<\/p>\n<p>    exit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5b8c\u6574\u4ee3\u7801\u793a\u4f8b<\/h3>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u4ee3\u7801\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u5c06\u722c\u53d6\u4e0b\u6765\u7684\u6587\u5b57\u5199\u5165\u6587\u4ef6\uff0c\u5e76\u5904\u7406\u5404\u79cd\u5f02\u5e38\u60c5\u51b5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>from bs4 import BeautifulSoup<\/p>\n<p>import csv<\/p>\n<p>url = &#39;https:\/\/example.com&#39;<\/p>\n<h2><strong>\u53d1\u9001\u7f51\u7edc\u8bf7\u6c42<\/strong><\/h2>\n<p>try:<\/p>\n<p>    response = requests.get(url)<\/p>\n<p>    response.raise_for_status()<\/p>\n<p>except requests.exceptions.RequestException as e:<\/p>\n<p>    print(f&quot;Failed to retrieve content: {e}&quot;)<\/p>\n<p>    exit()<\/p>\n<h2><strong>\u89e3\u6790HTML\u5185\u5bb9<\/strong><\/h2>\n<p>try:<\/p>\n<p>    soup = BeautifulSoup(response.text, &#39;lxml&#39;)<\/p>\n<p>except Exception as e:<\/p>\n<p>    print(f&quot;Failed to parse HTML content: {e}&quot;)<\/p>\n<p>    exit()<\/p>\n<h2><strong>\u63d0\u53d6\u6570\u636e<\/strong><\/h2>\n<p>paragraphs = soup.find_all(&#39;p&#39;)<\/p>\n<p>texts = [para.get_text() for para in paragraphs]<\/p>\n<h2><strong>\u5199\u5165\u6587\u672c\u6587\u4ef6<\/strong><\/h2>\n<p>file_path = &#39;output.txt&#39;<\/p>\n<p>try:<\/p>\n<p>    with open(file_path, &#39;w&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>        for text in texts:<\/p>\n<p>            file.write(text + &#39;\\n&#39;)<\/p>\n<p>    print(f&quot;Data has been written to {file_path}&quot;)<\/p>\n<p>except IOError as e:<\/p>\n<p>    print(f&quot;Failed to write to file: {e}&quot;)<\/p>\n<h2><strong>\u5199\u5165CSV\u6587\u4ef6<\/strong><\/h2>\n<p>csv_file_path = &#39;output.csv&#39;<\/p>\n<p>try:<\/p>\n<p>    with open(csv_file_path, &#39;w&#39;, encoding=&#39;utf-8&#39;, newline=&#39;&#39;) as file:<\/p>\n<p>        writer = csv.writer(file)<\/p>\n<p>        writer.writerow([&#39;Text&#39;])  # \u5199\u5165\u8868\u5934<\/p>\n<p>        for text in texts:<\/p>\n<p>            writer.writerow([text])<\/p>\n<p>    print(f&quot;Data has been written to {csv_file_path}&quot;)<\/p>\n<p>except IOError as e:<\/p>\n<p>    print(f&quot;Failed to write to file: {e}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Python\u722c\u866b\u5c06\u722c\u53d6\u4e0b\u6765\u7684\u6587\u5b57\u5199\u5165\u6587\u4ef6\u7684\u5b8c\u6574\u8fc7\u7a0b\uff0c\u5305\u62ec\u4f7f\u7528requests\u5e93\u8fdb\u884c\u7f51\u9875\u8bf7\u6c42\u3001\u4f7f\u7528BeautifulSoup\u5e93\u89e3\u6790\u7f51\u9875\u5185\u5bb9\u3001\u63d0\u53d6\u6240\u9700\u6570\u636e\uff0c\u5e76\u5c06\u5176\u5199\u5165\u6587\u672c\u6587\u4ef6\u548cCSV\u6587\u4ef6\u3002\u540c\u65f6\uff0c\u6211\u4eec\u8fd8\u8ba8\u8bba\u4e86\u5904\u7406\u5404\u79cd\u5f02\u5e38\u60c5\u51b5\u7684\u65b9\u6cd5\uff0c\u4ee5\u786e\u4fdd\u7a0b\u5e8f\u7684\u5065\u58ee\u6027\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u5b66\u4e60\u672c\u6587\u5185\u5bb9\uff0c\u4f60\u5c06\u638c\u63e1\u57fa\u672c\u7684Python\u722c\u866b\u6280\u672f\uff0c\u5e76\u80fd\u591f\u5c06\u722c\u53d6\u5230\u7684\u6570\u636e\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff0c\u4e3a\u540e\u7eed\u7684\u6570\u636e\u5206\u6790\u548c\u5904\u7406\u6253\u4e0b\u57fa\u7840\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5c06Python\u722c\u866b\u6293\u53d6\u7684\u5185\u5bb9\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff1f<\/strong><br \/>\u5728\u4f7f\u7528Python\u8fdb\u884c\u722c\u866b\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u6807\u51c6\u5e93\u4e2d\u7684\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd\u5c06\u6293\u53d6\u5230\u7684\u5185\u5bb9\u5199\u5165\u6587\u4ef6\u3002\u5e38\u89c1\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u4f7f\u7528requests\u5e93\u83b7\u53d6\u7f51\u9875\u5185\u5bb9\uff0c\u89e3\u6790\u9700\u8981\u7684\u4fe1\u606f\uff0c\u63a5\u7740\u4f7f\u7528open()\u51fd\u6570\u4ee5\u5199\u5165\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c\u6700\u540e\u901a\u8fc7write()\u65b9\u6cd5\u5c06\u6293\u53d6\u7684\u6587\u672c\u5199\u5165\u3002\u786e\u4fdd\u5728\u5199\u5165\u5b8c\u6210\u540e\u5173\u95ed\u6587\u4ef6\uff0c\u4ee5\u9632\u6b62\u6570\u636e\u4e22\u5931\u3002<\/p>\n<p><strong>\u4f7f\u7528\u54ea\u79cd\u6587\u4ef6\u683c\u5f0f\u4fdd\u5b58\u722c\u866b\u6570\u636e\u6700\u5408\u9002\uff1f<\/strong><br \/>\u6839\u636e\u6570\u636e\u7684\u7c7b\u578b\u548c\u540e\u7eed\u5904\u7406\u9700\u6c42\uff0c\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u6587\u4ef6\u683c\u5f0f\u4fdd\u5b58\u6570\u636e\u3002\u5e38\u89c1\u7684\u683c\u5f0f\u5305\u62ec\u6587\u672c\u6587\u4ef6\uff08.txt\uff09\u3001CSV\u6587\u4ef6\uff08.csv\uff09\u548cJSON\u6587\u4ef6\uff08.json\uff09\u3002\u6587\u672c\u6587\u4ef6\u9002\u5408\u7b80\u5355\u7684\u6587\u672c\u6570\u636e\uff0cCSV\u6587\u4ef6\u9002\u5408\u7ed3\u6784\u5316\u6570\u636e\uff0cJSON\u6587\u4ef6\u5219\u9002\u5408\u4fdd\u5b58\u590d\u6742\u7684\u5d4c\u5957\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<p><strong>\u5728\u5199\u6587\u4ef6\u65f6\u5982\u4f55\u907f\u514d\u6570\u636e\u4e22\u5931\u6216\u8986\u76d6\uff1f<\/strong><br \/>\u4e3a\u4e86\u907f\u514d\u6570\u636e\u4e22\u5931\u6216\u8986\u76d6\uff0c\u5efa\u8bae\u4f7f\u7528\u8ffd\u52a0\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5c06open()\u51fd\u6570\u7684\u6a21\u5f0f\u53c2\u6570\u8bbe\u7f6e\u4e3a&#39;a&#39;\uff08\u8ffd\u52a0\u6a21\u5f0f\uff09\u6765\u5b9e\u73b0\u3002\u8fd9\u4f1a\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u65b0\u5185\u5bb9\uff0c\u800c\u4e0d\u4f1a\u5220\u9664\u539f\u6709\u6570\u636e\u3002\u6b64\u5916\uff0c\u5b9a\u671f\u5907\u4efd\u6587\u4ef6\u4e5f\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff0c\u4ee5\u9632\u6b62\u610f\u5916\u60c5\u51b5\u9020\u6210\u7684\u6570\u636e\u4e22\u5931\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u722c\u866b\u8fc7\u7a0b\u4e2d\uff0c\u5c06\u722c\u53d6\u4e0b\u6765\u7684\u6587\u5b57\u5199\u5165\u6587\u4ef6\u7684\u6b65\u9aa4\u5305\u62ec\uff1a\u4f7f\u7528requests\u5e93\u8fdb\u884c\u7f51\u9875\u8bf7\u6c42\u3001\u4f7f\u7528Beau [&hellip;]","protected":false},"author":3,"featured_media":1104476,"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\/1104440"}],"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=1104440"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1104440\/revisions"}],"predecessor-version":[{"id":1104482,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1104440\/revisions\/1104482"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1104476"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1104440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1104440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1104440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}