{"id":1093702,"date":"2025-01-08T14:33:45","date_gmt":"2025-01-08T06:33:45","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1093702.html"},"modified":"2025-01-08T14:33:47","modified_gmt":"2025-01-08T06:33:47","slug":"python3%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e9%80%89%e6%8b%a9%e5%99%a8-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1093702.html","title":{"rendered":"python3\u5982\u4f55\u4f7f\u7528\u9009\u62e9\u5668"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24210145\/65154f12-2aa7-4924-aa00-f81e11e079d1.webp\" alt=\"python3\u5982\u4f55\u4f7f\u7528\u9009\u62e9\u5668\" \/><\/p>\n<p><p> \u5728Python3\u4e2d\u4f7f\u7528\u9009\u62e9\u5668\u7684\u65b9\u5f0f\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u9014\u5f84\u5b9e\u73b0\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528BeautifulSoup\u5e93\u6765\u89e3\u6790HTML\u6587\u6863\u5e76\u9009\u62e9\u5176\u4e2d\u7684\u5143\u7d20\u3002<strong>\u4f7f\u7528BeautifulSoup\u5e93\u3001\u901a\u8fc7CSS\u9009\u62e9\u5668\u3001\u901a\u8fc7HTML\u6807\u7b7e\u9009\u62e9\u5668\u3001\u901a\u8fc7\u5c5e\u6027\u9009\u62e9\u5668<\/strong>\uff0c\u8fd9\u4e9b\u90fd\u662f\u5e38\u89c1\u7684\u9009\u62e9\u5668\u65b9\u5f0f\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u9009\u62e9\u5668\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u5373\u901a\u8fc7CSS\u9009\u62e9\u5668\u6765\u9009\u62e9HTML\u6587\u6863\u4e2d\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><p>\u4f7f\u7528BeautifulSoup\u5e93\u7684CSS\u9009\u62e9\u5668\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u800c\u51c6\u786e\u5730\u9009\u62e9HTML\u6587\u6863\u4e2d\u7684\u5143\u7d20\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u5e76\u5bfc\u5165BeautifulSoup\u5e93\uff0c\u7136\u540e\u52a0\u8f7dHTML\u6587\u6863\uff0c\u63a5\u7740\u4f7f\u7528CSS\u9009\u62e9\u5668\u6765\u9009\u62e9\u6211\u4eec\u9700\u8981\u7684\u5143\u7d20\u3002CSS\u9009\u62e9\u5668\u8bed\u6cd5\u4e0e\u7f51\u9875\u5f00\u53d1\u4e2d\u5e38\u7528\u7684CSS\u9009\u62e9\u5668\u5b8c\u5168\u4e00\u81f4\uff0c\u5305\u62ec\u9009\u62e9\u6807\u7b7e\u3001\u7c7b\u3001ID\u4ee5\u53ca\u7ec4\u5408\u9009\u62e9\u5668\u7b49\u3002<\/p>\n<\/p>\n<hr>\n<p><h3>\u4e00\u3001\u5b89\u88c5\u4e0e\u5bfc\u5165BeautifulSoup<\/h3>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4f7f\u7528\u9009\u62e9\u5668\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5BeautifulSoup\u5e93\u3002\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 beautifulsoup4<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5728Python\u811a\u672c\u4e2d\u5bfc\u5165BeautifulSoup\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u52a0\u8f7dHTML\u6587\u6863<\/h3>\n<\/p>\n<p><p>\u8981\u4f7f\u7528\u9009\u62e9\u5668\u9009\u62e9HTML\u5143\u7d20\uff0c\u9996\u5148\u9700\u8981\u52a0\u8f7dHTML\u6587\u6863\u3002\u53ef\u4ee5\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6HTML\u5185\u5bb9\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4ece\u5b57\u7b26\u4e32\u4e2d\u52a0\u8f7dHTML\u5185\u5bb9\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">html_content = &quot;&quot;&quot;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;&lt;title&gt;Example Page&lt;\/title&gt;&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>  &lt;div class=&quot;cont<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ner&quot;&gt;<\/p>\n<p>    &lt;h1 id=&quot;main-heading&quot;&gt;Hello, World!&lt;\/h1&gt;<\/p>\n<p>    &lt;p class=&quot;intro&quot;&gt;Welcome to the example page.&lt;\/p&gt;<\/p>\n<p>    &lt;a href=&quot;https:\/\/example.com&quot; class=&quot;link&quot;&gt;Example Link&lt;\/a&gt;<\/p>\n<p>  &lt;\/div&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u901a\u8fc7CSS\u9009\u62e9\u5668\u9009\u62e9\u5143\u7d20<\/h3>\n<\/p>\n<p><h4>1. \u9009\u62e9\u6807\u7b7e<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u901a\u8fc7\u6807\u7b7e\u540d\u79f0\u6765\u9009\u62e9\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u9009\u62e9\u6240\u6709\u7684<code>&lt;p&gt;<\/code>\u6807\u7b7e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">paragraphs = soup.select(&#39;p&#39;)<\/p>\n<p>for p in paragraphs:<\/p>\n<p>    print(p.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u9009\u62e9\u7c7b<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u901a\u8fc7\u7c7b\u540d\u79f0\u6765\u9009\u62e9\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u9009\u62e9\u6240\u6709\u5177\u6709\u7c7b\u540d<code>intro<\/code>\u7684\u5143\u7d20\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">intro_elements = soup.select(&#39;.intro&#39;)<\/p>\n<p>for element in intro_elements:<\/p>\n<p>    print(element.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u9009\u62e9ID<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u901a\u8fc7ID\u9009\u62e9\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u9009\u62e9ID\u4e3a<code>main-heading<\/code>\u7684\u5143\u7d20\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">main_heading = soup.select(&#39;#main-heading&#39;)<\/p>\n<p>for heading in main_heading:<\/p>\n<p>    print(heading.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u7ec4\u5408\u9009\u62e9\u5668<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u7ec4\u5408\u591a\u4e2a\u9009\u62e9\u5668\u6765\u9009\u62e9\u66f4\u5177\u4f53\u7684\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u9009\u62e9\u6240\u6709\u7c7b\u540d\u4e3a<code>link<\/code>\u7684<code>&lt;a&gt;<\/code>\u6807\u7b7e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">links = soup.select(&#39;a.link&#39;)<\/p>\n<p>for link in links:<\/p>\n<p>    print(link[&#39;href&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u9009\u62e9\u5668\u7684\u5e94\u7528\u573a\u666f<\/h3>\n<\/p>\n<p><h4>1. \u722c\u53d6\u7f51\u9875\u5185\u5bb9<\/h4>\n<\/p>\n<p><p>\u9009\u62e9\u5668\u5728\u7f51\u9875\u722c\u866b\u4e2d\u6709\u5e7f\u6cdb\u5e94\u7528\u3002\u901a\u8fc7\u9009\u62e9\u5668\u53ef\u4ee5\u8f7b\u677e\u63d0\u53d6\u7f51\u9875\u4e2d\u7684\u7279\u5b9a\u5185\u5bb9\uff0c\u4f8b\u5982\u6587\u7ae0\u6807\u9898\u3001\u94fe\u63a5\u3001\u56fe\u7247\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>from bs4 import BeautifulSoup<\/p>\n<p>url = &#39;https:\/\/example.com&#39;<\/p>\n<p>response = requests.get(url)<\/p>\n<p>soup = BeautifulSoup(response.content, &#39;html.parser&#39;)<\/p>\n<p>titles = soup.select(&#39;h1&#39;)<\/p>\n<p>for title in titles:<\/p>\n<p>    print(title.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u6570\u636e\u6e05\u6d17\u4e0e\u6574\u7406<\/h4>\n<\/p>\n<p><p>\u5728\u6570\u636e\u6e05\u6d17\u4e0e\u6574\u7406\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u9009\u62e9\u5668\u63d0\u53d6\u9700\u8981\u7684\u6570\u636e\uff0c\u5e76\u5bf9\u6570\u636e\u8fdb\u884c\u6e05\u6d17\u548c\u6574\u7406\u3002\u4f8b\u5982\uff0c\u4eceHTML\u8868\u683c\u4e2d\u63d0\u53d6\u6570\u636e\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u7ed3\u6784\u5316\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">html_content = &quot;&quot;&quot;<\/p>\n<p>&lt;table&gt;<\/p>\n<p>  &lt;tr&gt;&lt;th&gt;Name&lt;\/th&gt;&lt;th&gt;Age&lt;\/th&gt;&lt;\/tr&gt;<\/p>\n<p>  &lt;tr&gt;&lt;td&gt;Alice&lt;\/td&gt;&lt;td&gt;24&lt;\/td&gt;&lt;\/tr&gt;<\/p>\n<p>  &lt;tr&gt;&lt;td&gt;Bob&lt;\/td&gt;&lt;td&gt;27&lt;\/td&gt;&lt;\/tr&gt;<\/p>\n<p>&lt;\/table&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<p>table_rows = soup.select(&#39;table tr&#39;)<\/p>\n<p>data = []<\/p>\n<p>for row in table_rows[1:]:<\/p>\n<p>    cells = row.select(&#39;td&#39;)<\/p>\n<p>    name = cells[0].text<\/p>\n<p>    age = cells[1].text<\/p>\n<p>    data.append({&#39;name&#39;: name, &#39;age&#39;: age})<\/p>\n<p>print(data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u8fdb\u9636\u7528\u6cd5<\/h3>\n<\/p>\n<p><h4>1. \u9009\u62e9\u5668\u7ec4\u5408<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u7ec4\u5408\u591a\u4e2a\u9009\u62e9\u5668\uff0c\u9009\u62e9\u66f4\u52a0\u5177\u4f53\u7684\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u9009\u62e9\u6240\u6709\u5177\u6709\u7c7b\u540d<code>item<\/code>\u7684<code>&lt;li&gt;<\/code>\u6807\u7b7e\u4e2d\u7684\u6240\u6709<code>&lt;a&gt;<\/code>\u6807\u7b7e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">html_content = &quot;&quot;&quot;<\/p>\n<p>&lt;ul&gt;<\/p>\n<p>  &lt;li class=&quot;item&quot;&gt;&lt;a href=&quot;https:\/\/example.com\/item1&quot;&gt;Item 1&lt;\/a&gt;&lt;\/li&gt;<\/p>\n<p>  &lt;li class=&quot;item&quot;&gt;&lt;a href=&quot;https:\/\/example.com\/item2&quot;&gt;Item 2&lt;\/a&gt;&lt;\/li&gt;<\/p>\n<p>&lt;\/ul&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<p>links = soup.select(&#39;li.item a&#39;)<\/p>\n<p>for link in links:<\/p>\n<p>    print(link[&#39;href&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u9009\u62e9\u5668\u5c5e\u6027\u9009\u62e9<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u901a\u8fc7\u5c5e\u6027\u9009\u62e9\u5668\u9009\u62e9\u5177\u6709\u7279\u5b9a\u5c5e\u6027\u7684\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u9009\u62e9\u6240\u6709\u5177\u6709<code>href<\/code>\u5c5e\u6027\u7684<code>&lt;a&gt;<\/code>\u6807\u7b7e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">html_content = &quot;&quot;&quot;<\/p>\n<p>&lt;a href=&quot;https:\/\/example.com&quot;&gt;Example&lt;\/a&gt;<\/p>\n<p>&lt;a&gt;Without Link&lt;\/a&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<p>links = soup.select(&#39;a[href]&#39;)<\/p>\n<p>for link in links:<\/p>\n<p>    print(link[&#39;href&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u9009\u62e9\u5668\u5c42\u7ea7\u9009\u62e9<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u901a\u8fc7\u9009\u62e9\u5668\u5c42\u7ea7\u9009\u62e9\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u9009\u62e9\u6240\u6709\u5728<code>&lt;div&gt;<\/code>\u6807\u7b7e\u5185\u7684<code>&lt;p&gt;<\/code>\u6807\u7b7e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">html_content = &quot;&quot;&quot;<\/p>\n<p>&lt;div&gt;<\/p>\n<p>  &lt;p&gt;First Paragraph&lt;\/p&gt;<\/p>\n<p>  &lt;p&gt;Second Paragraph&lt;\/p&gt;<\/p>\n<p>&lt;\/div&gt;<\/p>\n<p>&lt;p&gt;Outside Paragraph&lt;\/p&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<p>div_paragraphs = soup.select(&#39;div &gt; p&#39;)<\/p>\n<p>for p in div_paragraphs:<\/p>\n<p>    print(p.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u8be6\u7ec6\u8bb2\u89e3\u4e86\u5728Python3\u4e2d\u5982\u4f55\u4f7f\u7528BeautifulSoup\u5e93\u7684\u9009\u62e9\u5668\u6765\u9009\u62e9HTML\u6587\u6863\u4e2d\u7684\u5143\u7d20\u3002<strong>\u4f7f\u7528BeautifulSoup\u5e93\u3001\u901a\u8fc7CSS\u9009\u62e9\u5668\u3001\u901a\u8fc7HTML\u6807\u7b7e\u9009\u62e9\u5668\u3001\u901a\u8fc7\u5c5e\u6027\u9009\u62e9\u5668<\/strong>\uff0c\u8fd9\u4e9b\u90fd\u662f\u5e38\u89c1\u7684\u9009\u62e9\u5668\u65b9\u5f0f\u3002\u901a\u8fc7\u8fd9\u4e9b\u9009\u62e9\u5668\uff0c\u6211\u4eec\u53ef\u4ee5\u65b9\u4fbf\u5730\u9009\u62e9\u5e76\u63d0\u53d6\u7f51\u9875\u4e2d\u7684\u7279\u5b9a\u5185\u5bb9\uff0c\u65e0\u8bba\u662f\u5728\u7f51\u9875\u722c\u866b\u3001\u6570\u636e\u6e05\u6d17\u4e0e\u6574\u7406\uff0c\u8fd8\u662f\u5728\u5176\u4ed6\u6570\u636e\u5904\u7406\u4efb\u52a1\u4e2d\uff0c\u8fd9\u4e9b\u9009\u62e9\u5668\u90fd\u80fd\u53d1\u6325\u91cd\u8981\u4f5c\u7528\u3002\u638c\u63e1\u8fd9\u4e9b\u9009\u62e9\u5668\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u5c06\u5e2e\u52a9\u6211\u4eec\u66f4\u52a0\u9ad8\u6548\u5730\u5904\u7406\u548c\u5206\u6790\u7f51\u9875\u6570\u636e\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u9009\u62e9\u5668\u5728Python3\u4e2d\u7684\u4f5c\u7528\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u9009\u62e9\u5668\u5728Python3\u4e2d\u4e3b\u8981\u7528\u4e8e\u4eceHTML\u6216XML\u6587\u6863\u4e2d\u63d0\u53d6\u6570\u636e\u3002\u901a\u8fc7\u4f7f\u7528\u9009\u62e9\u5668\uff0c\u7528\u6237\u80fd\u591f\u65b9\u4fbf\u5730\u83b7\u53d6\u7279\u5b9a\u5143\u7d20\u6216\u5c5e\u6027\uff0c\u4ece\u800c\u5b9e\u73b0\u6570\u636e\u7684\u63d0\u53d6\u548c\u5904\u7406\u3002\u5e38\u7528\u7684\u9009\u62e9\u5668\u5e93\u5305\u62ecBeautifulSoup\u548clxml\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u5141\u8bb8\u7528\u6237\u4f7f\u7528CSS\u9009\u62e9\u5668\u6216XPath\u8868\u8fbe\u5f0f\u6765\u9009\u62e9\u548c\u64cd\u4f5c\u6587\u6863\u5185\u5bb9\u3002<\/p>\n<p><strong>\u5728Python3\u4e2d\u4f7f\u7528\u9009\u62e9\u5668\u7684\u6b65\u9aa4\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u4f7f\u7528\u9009\u62e9\u5668\u7684\u6b65\u9aa4\u901a\u5e38\u5305\u62ec\u51e0\u4e2a\u5173\u952e\u73af\u8282\uff1a\u9996\u5148\uff0c\u5b89\u88c5\u6240\u9700\u7684\u5e93\uff0c\u4f8b\u5982BeautifulSoup\u6216lxml\u3002\u63a5\u7740\uff0c\u52a0\u8f7d\u9700\u8981\u89e3\u6790\u7684HTML\u6216XML\u6587\u6863\u3002\u7136\u540e\uff0c\u5229\u7528\u9009\u62e9\u5668\u65b9\u6cd5\uff08\u5982find\u3001find_all\u3001select\u7b49\uff09\u6765\u5b9a\u4f4d\u5e76\u63d0\u53d6\u6240\u9700\u7684\u6570\u636e\u3002\u6700\u540e\uff0c\u5904\u7406\u63d0\u53d6\u7684\u6570\u636e\uff0c\u6839\u636e\u9700\u6c42\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u5206\u6790\u6216\u5b58\u50a8\u3002<\/p>\n<p><strong>\u9009\u62e9\u5668\u4e0e\u6b63\u5219\u8868\u8fbe\u5f0f\u76f8\u6bd4\uff0c\u6709\u54ea\u4e9b\u4f18\u7f3a\u70b9\uff1f<\/strong><br \/>\u9009\u62e9\u5668\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u5404\u6709\u5176\u72ec\u7279\u7684\u4f18\u52bf\u548c\u5c40\u9650\u6027\u3002\u9009\u62e9\u5668\u5728\u5904\u7406HTML\u548cXML\u6587\u6863\u65f6\u66f4\u4e3a\u76f4\u89c2\uff0c\u80fd\u591f\u5feb\u901f\u5b9a\u4f4d\u6807\u7b7e\u548c\u5c5e\u6027\uff0c\u975e\u5e38\u9002\u5408\u89e3\u6790\u7ed3\u6784\u5316\u6570\u636e\u3002\u76f8\u6bd4\u4e4b\u4e0b\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u5728\u5904\u7406\u65e0\u7ed3\u6784\u6570\u636e\u65f6\u5219\u66f4\u4e3a\u7075\u6d3b\uff0c\u9002\u5408\u590d\u6742\u7684\u5b57\u7b26\u4e32\u6a21\u5f0f\u5339\u914d\u3002\u7136\u800c\uff0c\u9009\u62e9\u5668\u7684\u5b66\u4e60\u66f2\u7ebf\u76f8\u5bf9\u8f83\u4f4e\uff0c\u800c\u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u80fd\u9700\u8981\u66f4\u9ad8\u7684\u5b66\u4e60\u6210\u672c\u3002\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u4f7f\u7528\u573a\u666f\u548c\u6570\u636e\u683c\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python3\u4e2d\u4f7f\u7528\u9009\u62e9\u5668\u7684\u65b9\u5f0f\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u9014\u5f84\u5b9e\u73b0\uff0c\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528BeautifulSoup\u5e93\u6765\u89e3\u6790H [&hellip;]","protected":false},"author":3,"featured_media":1093704,"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\/1093702"}],"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=1093702"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1093702\/revisions"}],"predecessor-version":[{"id":1093705,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1093702\/revisions\/1093705"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1093704"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1093702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1093702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1093702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}