{"id":1011096,"date":"2024-12-27T11:26:57","date_gmt":"2024-12-27T03:26:57","guid":{"rendered":""},"modified":"2024-12-27T11:27:00","modified_gmt":"2024-12-27T03:27:00","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e6%8a%93%e5%8f%96%e7%94%b5%e5%bd%b1","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1011096.html","title":{"rendered":"\u5982\u4f55\u7528python\u6293\u53d6\u7535\u5f71"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25085352\/473fd4f5-0a2f-4f2e-8daf-00227d863e01.webp\" alt=\"\u5982\u4f55\u7528python\u6293\u53d6\u7535\u5f71\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u6293\u53d6\u7535\u5f71\u6570\u636e\u4e3b\u8981\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528\u7f51\u7edc\u722c\u866b\u6280\u672f\u3001\u5229\u7528\u7b2c\u4e09\u65b9API\u3001\u89e3\u6790\u7f51\u9875\u7ed3\u6784\u3002<\/strong>\u5728\u8fd9\u4e09\u79cd\u65b9\u6cd5\u4e2d\uff0c<strong>\u4f7f\u7528\u7f51\u7edc\u722c\u866b\u6280\u672f<\/strong>\u662f\u6700\u5e38\u89c1\u4e14\u7075\u6d3b\u6027\u6700\u9ad8\u7684\u4e00\u79cd\u65b9\u5f0f\u3002\u7f51\u7edc\u722c\u866b\u53ef\u4ee5\u901a\u8fc7\u6a21\u62df\u6d4f\u89c8\u5668\u8bf7\u6c42\uff0c\u6293\u53d6\u7f51\u9875\u4e0a\u7684\u6570\u636e\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u7f51\u7edc\u722c\u866b\u6293\u53d6\u7535\u5f71\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u7f51\u7edc\u722c\u866b\u6280\u672f<\/p>\n<\/p>\n<p><p>\u7f51\u7edc\u722c\u866b\u662f\u4e00\u79cd\u81ea\u52a8\u5316\u7a0b\u5e8f\uff0c\u901a\u8fc7\u6a21\u62df\u6d4f\u89c8\u5668\u8bf7\u6c42\u83b7\u53d6\u7f51\u9875\u6570\u636e\u3002Python\u6709\u591a\u4e2a\u4f18\u79c0\u7684\u5e93\u53ef\u4ee5\u7528\u6765\u7f16\u5199\u722c\u866b\u7a0b\u5e8f\uff0c\u5982<code>requests<\/code>\u548c<code>BeautifulSoup<\/code>\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5\u5fc5\u8981\u7684\u5e93<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e9bPython\u5e93\u3002\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5<code>requests<\/code>\u548c<code>BeautifulSoup<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests<\/p>\n<p>pip install beautifulsoup4<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u53d1\u9001HTTP\u8bf7\u6c42<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528<code>requests<\/code>\u5e93\u53ef\u4ee5\u65b9\u4fbf\u5730\u53d1\u9001HTTP\u8bf7\u6c42\uff0c\u4ece\u7f51\u9875\u670d\u52a1\u5668\u83b7\u53d6HTML\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>url = &#39;http:\/\/example.com\/movies&#39;<\/p>\n<p>response = requests.get(url)<\/p>\n<p>html_content = response.text<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u89e3\u6790HTML\u5185\u5bb9<\/strong><\/li>\n<\/ol>\n<p><p>\u83b7\u53d6\u5230HTML\u5185\u5bb9\u540e\uff0c\u4f7f\u7528<code>BeautifulSoup<\/code>\u89e3\u6790\u5b83\u3002\u8fd9\u662f\u4e00\u4e2a\u89e3\u6790HTML\u548cXML\u7684\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u5730\u4ece\u4e2d\u63d0\u53d6\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u63d0\u53d6\u7535\u5f71\u6570\u636e<\/strong><\/li>\n<\/ol>\n<p><p>\u6839\u636e\u7f51\u9875\u7684\u7ed3\u6784\uff0c\u4f7f\u7528BeautifulSoup\u7684\u65b9\u6cd5\uff0c\u5982<code>find_all()<\/code>\u3001<code>find()<\/code>\u7b49\uff0c\u63d0\u53d6\u6240\u9700\u7684\u7535\u5f71\u6570\u636e\u3002\u4f8b\u5982\uff0c\u5982\u679c\u7535\u5f71\u7684\u6807\u9898\u5728<code>&lt;h2&gt;<\/code>\u6807\u7b7e\u4e2d\uff0c\u53ef\u4ee5\u8fd9\u6837\u63d0\u53d6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">movies = soup.find_all(&#39;h2&#39;, class_=&#39;movie-title&#39;)<\/p>\n<p>for movie in movies:<\/p>\n<p>    title = movie.text<\/p>\n<p>    print(title)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"5\">\n<li><strong>\u5904\u7406\u52a8\u6001\u5185\u5bb9<\/strong><\/li>\n<\/ol>\n<p><p>\u6709\u4e9b\u7f51\u7ad9\u7684\u5185\u5bb9\u662f\u901a\u8fc7JavaScript\u52a8\u6001\u52a0\u8f7d\u7684\u3002\u5bf9\u4e8e\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528<code>Selenium<\/code>\u5e93\u6765\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install selenium<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528Selenium\u9700\u8981\u4e0b\u8f7d\u6d4f\u89c8\u5668\u7684\u9a71\u52a8\u7a0b\u5e8f\uff0c\u5982ChromeDriver\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from selenium import webdriver<\/p>\n<p>driver = webdriver.Chrome(executable_path=&#39;\/path\/to\/chromedriver&#39;)<\/p>\n<p>driver.get(&#39;http:\/\/example.com\/movies&#39;)<\/p>\n<p>html_content = driver.page_source<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<h2><strong>\u63d0\u53d6\u6570\u636e\u540c\u4e0a<\/strong><\/h2>\n<p>driver.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u5229\u7528\u7b2c\u4e09\u65b9API<\/p>\n<\/p>\n<p><p>\u6709\u4e9b\u7f51\u7ad9\u63d0\u4f9b\u4e86API\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Python\u8bf7\u6c42\u83b7\u53d6\u6570\u636e\u3002\u8fd9\u901a\u5e38\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3aAPI\u8fd4\u56de\u7684\u6570\u636e\u901a\u5e38\u662f\u7ed3\u6784\u5316\u7684JSON\u683c\u5f0f\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u6ce8\u518cAPI\u5bc6\u94a5<\/strong><\/li>\n<\/ol>\n<p><p>\u9996\u5148\u9700\u8981\u5728\u63d0\u4f9bAPI\u7684\u7f51\u7ad9\u4e0a\u6ce8\u518c\u83b7\u53d6API\u5bc6\u94a5\u3002\u4ee5TMDB\uff08The Movie Database\uff09\u4e3a\u4f8b\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u53d1\u9001API\u8bf7\u6c42<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528<code>requests<\/code>\u5e93\u53d1\u9001\u8bf7\u6c42\u5e76\u83b7\u53d6\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>api_key = &#39;your_api_key&#39;<\/p>\n<p>url = f&#39;https:\/\/api.themoviedb.org\/3\/movie\/popular?api_key={api_key}&#39;<\/p>\n<p>response = requests.get(url)<\/p>\n<p>data = response.json()<\/p>\n<p>for movie in data[&#39;results&#39;]:<\/p>\n<p>    print(movie[&#39;title&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u89e3\u6790\u7f51\u9875\u7ed3\u6784<\/p>\n<\/p>\n<p><p>\u89e3\u6790\u7f51\u9875\u7ed3\u6784\u9700\u8981\u4e86\u89e3\u7f51\u9875\u7684HTML\u7ed3\u6784\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u5f00\u53d1\u8005\u5de5\u5177\u67e5\u770b\u7f51\u9875\u7684DOM\u7ed3\u6784\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5206\u6790\u7f51\u9875\u7ed3\u6784<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528\u6d4f\u89c8\u5668\u7684\u5f00\u53d1\u8005\u5de5\u5177\uff08F12\uff09\u67e5\u770b\u7f51\u9875\u7684HTML\u7ed3\u6784\uff0c\u627e\u5230\u5305\u542b\u7535\u5f71\u6570\u636e\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u7f16\u5199\u89e3\u6790\u4ee3\u7801<\/strong><\/li>\n<\/ol>\n<p><p>\u6839\u636e\u5206\u6790\u7684\u7ed3\u679c\uff0c\u7f16\u5199\u4ee3\u7801\u63d0\u53d6\u6240\u9700\u6570\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>html_content = &#39;&lt;html&gt;...&lt;\/html&gt;&#39;  # \u5047\u8bbe\u8fd9\u662f\u4ece\u7f51\u9875\u83b7\u53d6\u5230\u7684HTML<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<h2><strong>\u5047\u8bbe\u7535\u5f71\u4fe1\u606f\u5728&lt;div class=&quot;movie&quot;&gt;\u4e2d<\/strong><\/h2>\n<p>movies = soup.find_all(&#39;div&#39;, class_=&#39;movie&#39;)<\/p>\n<p>for movie in movies:<\/p>\n<p>    title = movie.find(&#39;h2&#39;).text<\/p>\n<p>    print(title)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u5904\u7406\u53cd\u722c\u673a\u5236<\/p>\n<\/p>\n<p><p>\u8bb8\u591a\u7f51\u7ad9\u90fd\u6709\u53cd\u722c\u673a\u5236\uff0c\u5982IP\u5c01\u9501\u3001\u9a8c\u8bc1\u7801\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u5e94\u5bf9\u63aa\u65bd\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528\u4ee3\u7406<\/strong><\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4f7f\u7528\u4ee3\u7406IP\uff0c\u53ef\u4ee5\u907f\u514d\u56e0\u9891\u7e41\u8bf7\u6c42\u88ab\u5c01\u9501\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">proxies = {<\/p>\n<p>    &#39;http&#39;: &#39;http:\/\/10.10.1.10:3128&#39;,<\/p>\n<p>    &#39;https&#39;: &#39;http:\/\/10.10.1.10:1080&#39;,<\/p>\n<p>}<\/p>\n<p>response = requests.get(url, proxies=proxies)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u6a21\u62df\u6d4f\u89c8\u5668\u5934<\/strong><\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4fee\u6539\u8bf7\u6c42\u5934\u4fe1\u606f\uff0c\u53ef\u4ee5\u8ba9\u670d\u52a1\u5668\u8ba4\u4e3a\u8bf7\u6c42\u6765\u81ea\u6d4f\u89c8\u5668\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">headers = {<\/p>\n<p>    &#39;User-Agent&#39;: &#39;Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/91.0.4472.124 Safari\/537.36&#39;<\/p>\n<p>}<\/p>\n<p>response = requests.get(url, headers=headers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u4f7f\u7528\u5ef6\u8fdf<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u8bf7\u6c42\u4e4b\u95f4\u52a0\u5165\u5ef6\u8fdf\uff0c\u907f\u514d\u9891\u7e41\u8bf7\u6c42\u88ab\u5c01\u9501\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<p>time.sleep(5)  # \u5ef6\u8fdf5\u79d2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u6570\u636e\u5b58\u50a8\u548c\u5904\u7406<\/p>\n<\/p>\n<p><p>\u6293\u53d6\u5230\u7684\u7535\u5f71\u6570\u636e\u53ef\u4ee5\u5b58\u50a8\u5230\u6570\u636e\u5e93\u6216\u8005\u6587\u4ef6\u4e2d\uff0c\u4ee5\u4fbf\u540e\u7eed\u5904\u7406\u548c\u5206\u6790\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b58\u50a8\u5230\u6587\u4ef6<\/strong><\/li>\n<\/ol>\n<p><p>\u53ef\u4ee5\u5c06\u6570\u636e\u5b58\u50a8\u5230CSV\u6587\u4ef6\u4e2d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import csv<\/p>\n<p>with open(&#39;movies.csv&#39;, &#39;w&#39;, newline=&#39;&#39;, encoding=&#39;utf-8&#39;) as file:<\/p>\n<p>    writer = csv.writer(file)<\/p>\n<p>    writer.writerow([&#39;Title&#39;, &#39;Year&#39;, &#39;Rating&#39;])<\/p>\n<p>    for movie in movies:<\/p>\n<p>        writer.writerow([movie[&#39;title&#39;], movie[&#39;year&#39;], movie[&#39;rating&#39;]])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5b58\u50a8\u5230\u6570\u636e\u5e93<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528<code>sqlite3<\/code>\u5e93\u5c06\u6570\u636e\u5b58\u50a8\u5230SQLite\u6570\u636e\u5e93\u4e2d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import sqlite3<\/p>\n<p>conn = sqlite3.connect(&#39;movies.db&#39;)<\/p>\n<p>c = conn.cursor()<\/p>\n<p>c.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS movies<\/p>\n<p>             (title TEXT, year INTEGER, rating REAL)&#39;&#39;&#39;)<\/p>\n<p>for movie in movies:<\/p>\n<p>    c.execute(&quot;INSERT INTO movies (title, year, rating) VALUES (?, ?, ?)&quot;,<\/p>\n<p>              (movie[&#39;title&#39;], movie[&#39;year&#39;], movie[&#39;rating&#39;]))<\/p>\n<p>conn.commit()<\/p>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316<\/strong><\/li>\n<\/ol>\n<p><p>\u6293\u53d6\u5230\u7684\u6570\u636e\u53ef\u4ee5\u4f7f\u7528Python\u7684\u6570\u636e\u5206\u6790\u5e93\uff0c\u5982<code>pandas<\/code>\u548c<code>matplotlib<\/code>\uff0c\u8fdb\u884c\u5206\u6790\u548c\u53ef\u89c6\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import matplotlib.pyplot as plt<\/p>\n<p>df = pd.read_csv(&#39;movies.csv&#39;)<\/p>\n<p>df[&#39;Rating&#39;].plot(kind=&#39;hist&#39;, title=&#39;Movie Ratings&#39;)<\/p>\n<p>plt.show()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u6293\u53d6\u3001\u5b58\u50a8\u548c\u5206\u6790\u7535\u5f71\u6570\u636e\u3002\u4e0d\u540c\u7684\u7f51\u7ad9\u7ed3\u6784\u548c\u53cd\u722c\u673a\u5236\u53ef\u80fd\u9700\u8981\u4e0d\u540c\u7684\u5904\u7406\u65b9\u5f0f\uff0c\u56e0\u6b64\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\u9700\u8981\u7075\u6d3b\u8c03\u6574\u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u6293\u53d6\u7279\u5b9a\u7535\u5f71\u7684\u4fe1\u606f\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528Python\u4e2d\u7684\u5e93\u5982BeautifulSoup\u548cRequests\u6765\u6293\u53d6\u7279\u5b9a\u7535\u5f71\u7684\u4fe1\u606f\u3002\u9996\u5148\uff0c\u4f7f\u7528Requests\u5e93\u53d1\u9001HTTP\u8bf7\u6c42\u83b7\u53d6\u76ee\u6807\u7f51\u9875\u7684HTML\u5185\u5bb9\uff0c\u7136\u540e\u4f7f\u7528BeautifulSoup\u89e3\u6790HTML\uff0c\u63d0\u53d6\u6240\u9700\u7684\u7535\u5f71\u4fe1\u606f\uff0c\u4f8b\u5982\u6807\u9898\u3001\u8bc4\u5206\u3001\u7b80\u4ecb\u7b49\u3002\u786e\u4fdd\u9075\u5faa\u7f51\u7ad9\u7684\u722c\u866b\u653f\u7b56\uff0c\u4ee5\u514d\u8fdd\u53cd\u5176\u4f7f\u7528\u6761\u6b3e\u3002<\/p>\n<p><strong>\u6293\u53d6\u7535\u5f71\u6570\u636e\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u6cd5\u5f8b\u548c\u4f26\u7406\u95ee\u9898\uff1f<\/strong><br \/>\u5728\u6293\u53d6\u7535\u5f71\u6570\u636e\u65f6\uff0c\u52a1\u5fc5\u8981\u9075\u5faa\u7f51\u7ad9\u7684robots.txt\u6587\u4ef6\u4e2d\u7684\u722c\u866b\u534f\u8bae\uff0c\u5c0a\u91cd\u7f51\u7ad9\u7684\u7248\u6743\u548c\u6570\u636e\u4f7f\u7528\u653f\u7b56\u3002\u907f\u514d\u6293\u53d6\u654f\u611f\u6216\u79c1\u4eba\u4fe1\u606f\uff0c\u5e76\u5c3d\u53ef\u80fd\u4f7f\u7528\u516c\u5f00\u7684API\u6765\u83b7\u53d6\u6570\u636e\uff0c\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u6cd5\u5f8b\u98ce\u9669\u3002<\/p>\n<p><strong>\u5982\u4f55\u63d0\u9ad8Python\u6293\u53d6\u7535\u5f71\u7684\u6548\u7387\u548c\u7a33\u5b9a\u6027\uff1f<\/strong><br \/>\u63d0\u9ad8\u6293\u53d6\u6548\u7387\u53ef\u4ee5\u901a\u8fc7\u591a\u7ebf\u7a0b\u6216\u5f02\u6b65\u7f16\u7a0b\u5b9e\u73b0\uff0c\u4ee5\u540c\u65f6\u5904\u7406\u591a\u4e2a\u8bf7\u6c42\u3002\u6b64\u5916\uff0c\u8bbe\u7f6e\u5408\u9002\u7684\u8bf7\u6c42\u95f4\u9694\u65f6\u95f4\uff0c\u907f\u514d\u9891\u7e41\u8bf7\u6c42\u540c\u4e00\u7f51\u7ad9\u9020\u6210IP\u88ab\u5c01\u7981\u3002\u4f7f\u7528\u4ee3\u7406\u670d\u52a1\u5668\u548c\u7528\u6237\u4ee3\u7406\u5934\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u9ad8\u7a33\u5b9a\u6027\uff0c\u786e\u4fdd\u6293\u53d6\u8fc7\u7a0b\u987a\u5229\u8fdb\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u6293\u53d6\u7535\u5f71\u6570\u636e\u4e3b\u8981\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\uff1a\u4f7f\u7528\u7f51\u7edc\u722c\u866b\u6280\u672f\u3001\u5229\u7528\u7b2c\u4e09\u65b9API\u3001\u89e3\u6790\u7f51\u9875\u7ed3\u6784\u3002\u5728\u8fd9\u4e09\u79cd\u65b9 [&hellip;]","protected":false},"author":3,"featured_media":1011103,"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\/1011096"}],"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=1011096"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1011096\/revisions"}],"predecessor-version":[{"id":1011105,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1011096\/revisions\/1011105"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1011103"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1011096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1011096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1011096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}