{"id":981185,"date":"2024-12-27T07:00:34","date_gmt":"2024-12-26T23:00:34","guid":{"rendered":""},"modified":"2024-12-27T07:00:37","modified_gmt":"2024-12-26T23:00:37","slug":"python%e5%a6%82%e4%bd%95%e8%8e%b7%e5%8f%96%e8%a1%8c%e5%86%85%e5%85%83%e7%b4%a0","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/981185.html","title":{"rendered":"python\u5982\u4f55\u83b7\u53d6\u884c\u5185\u5143\u7d20"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24210236\/69a36554-7370-4155-973d-719be86a1fc4.webp\" alt=\"python\u5982\u4f55\u83b7\u53d6\u884c\u5185\u5143\u7d20\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\u83b7\u53d6\u884c\u5185\u5143\u7d20\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528BeautifulSoup\u89e3\u6790HTML\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u3001\u4ee5\u53ca\u901a\u8fc7Selenium\u8fdb\u884c\u6d4f\u89c8\u5668\u81ea\u52a8\u5316\u64cd\u4f5c\u3002\u5176\u4e2d\uff0cBeautifulSoup\u662f\u6700\u5e38\u7528\u7684\u5de5\u5177\uff0c\u56e0\u4e3a\u5b83\u7b80\u5355\u6613\u7528\u4e14\u529f\u80fd\u5f3a\u5927\u3002<\/strong>\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528BeautifulSoup\u83b7\u53d6\u884c\u5185\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><p>BeautifulSoup\u662f\u4e00\u4e2a\u7528\u4e8e\u89e3\u6790HTML\u548cXML\u6587\u6863\u7684Python\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u904d\u5386\u3001\u641c\u7d22\u548c\u4fee\u6539\u89e3\u6790\u6811\u3002\u83b7\u53d6\u884c\u5185\u5143\u7d20\u901a\u5e38\u6d89\u53ca\u4eceHTML\u6587\u6863\u4e2d\u63d0\u53d6\u7279\u5b9a\u7684\u6807\u7b7e\u6216\u5c5e\u6027\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528BeautifulSoup\u83b7\u53d6\u884c\u5185\u5143\u7d20\u7684\u8be6\u7ec6\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5BeautifulSoup\u5e93\u548crequests\u5e93\uff0c\u4ee5\u4fbf\u80fd\u591f\u4e0b\u8f7d\u548c\u89e3\u6790HTML\u5185\u5bb9\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u8fd9\u4e9b\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install beautifulsoup4<\/p>\n<p>pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4f7f\u7528BeautifulSoup\u89e3\u6790\u4e00\u4e2a\u7b80\u5355\u7684HTML\u6587\u6863\uff0c\u5e76\u63d0\u53d6\u5176\u4e2d\u7684\u884c\u5185\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>import requests<\/p>\n<h2><strong>\u8bf7\u6c42\u7f51\u9875\u5185\u5bb9<\/strong><\/h2>\n<p>url = &#39;http:\/\/example.com&#39;<\/p>\n<p>response = requests.get(url)<\/p>\n<p>html_content = response.text<\/p>\n<h2><strong>\u89e3\u6790HTML\u6587\u6863<\/strong><\/h2>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<h2><strong>\u83b7\u53d6\u6240\u6709\u7684\u884c\u5185\u5143\u7d20\uff0c\u4f8b\u5982 &lt;span&gt;<\/strong><\/h2>\n<p>inline_elements = soup.find_all(&#39;span&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements:<\/p>\n<p>    print(element.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528requests\u5e93\u83b7\u53d6\u7f51\u9875\u7684HTML\u5185\u5bb9\uff0c\u7136\u540e\u4f7f\u7528BeautifulSoup\u89e3\u6790\u8be5HTML\u6587\u6863\u3002\u6211\u4eec\u4f7f\u7528<code>find_all<\/code>\u65b9\u6cd5\u83b7\u53d6\u6240\u6709\u7684<code>&lt;span&gt;<\/code>\u6807\u7b7e\uff0c\u8fd9\u4e9b\u6807\u7b7e\u901a\u5e38\u7528\u4e8e\u5b9a\u4e49\u884c\u5185\u5143\u7d20\u3002\u6700\u540e\uff0c\u6211\u4eec\u904d\u5386\u8fd9\u4e9b\u5143\u7d20\u5e76\u8f93\u51fa\u5176\u6587\u672c\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4ed6\u83b7\u53d6\u884c\u5185\u5143\u7d20\u7684\u65b9\u6cd5\u4ee5\u53caBeautifulSoup\u7684\u9ad8\u7ea7\u7528\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528BeautifulSoup\u83b7\u53d6\u884c\u5185\u5143\u7d20<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5\u548c\u57fa\u672c\u4f7f\u7528<\/li>\n<\/ol>\n<p><p>BeautifulSoup\u662f\u4e00\u4e2a\u5f3a\u5927\u7684HTML\/XML\u89e3\u6790\u5e93\uff0c\u5b83\u80fd\u591f\u8f7b\u677e\u5730\u89e3\u6790\u548c\u63d0\u53d6\u7f51\u9875\u4e2d\u7684\u6570\u636e\u3002\u901a\u8fc7\u4f7f\u7528requests\u5e93\u83b7\u53d6\u7f51\u9875\u5185\u5bb9\uff0c\u7136\u540e\u5229\u7528BeautifulSoup\u89e3\u6790\uff0c\u53ef\u4ee5\u8f7b\u677e\u83b7\u53d6\u884c\u5185\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>import requests<\/p>\n<h2><strong>\u8bf7\u6c42\u7f51\u9875\u5185\u5bb9<\/strong><\/h2>\n<p>url = &#39;http:\/\/example.com&#39;<\/p>\n<p>response = requests.get(url)<\/p>\n<p>html_content = response.text<\/p>\n<h2><strong>\u89e3\u6790HTML\u6587\u6863<\/strong><\/h2>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<h2><strong>\u83b7\u53d6\u6240\u6709\u7684\u884c\u5185\u5143\u7d20\uff0c\u4f8b\u5982 &lt;span&gt;<\/strong><\/h2>\n<p>inline_elements = soup.find_all(&#39;span&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements:<\/p>\n<p>    print(element.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528CSS\u9009\u62e9\u5668<\/li>\n<\/ol>\n<p><p>\u9664\u4e86<code>find_all<\/code>\u65b9\u6cd5\uff0cBeautifulSoup\u8fd8\u652f\u6301\u4f7f\u7528CSS\u9009\u62e9\u5668\u6765\u67e5\u627e\u5143\u7d20\u3002CSS\u9009\u62e9\u5668\u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u52a0\u7b80\u6d01\u548c\u7075\u6d3b\u7684\u65b9\u5f0f\u6765\u5b9a\u4f4dHTML\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528CSS\u9009\u62e9\u5668\u83b7\u53d6\u884c\u5185\u5143\u7d20<\/p>\n<p>inline_elements = soup.select(&#39;span&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements:<\/p>\n<p>    print(element.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u67e5\u627e\u7279\u5b9a\u5c5e\u6027\u7684\u884c\u5185\u5143\u7d20<\/li>\n<\/ol>\n<p><p>\u6709\u65f6\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u67e5\u627e\u5177\u6709\u7279\u5b9a\u5c5e\u6027\u7684\u884c\u5185\u5143\u7d20\u3002BeautifulSoup\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u67e5\u627e\u5177\u6709\u7279\u5b9a\u7c7b\u540d\u7684\u884c\u5185\u5143\u7d20<\/p>\n<p>inline_elements_with_class = soup.find_all(&#39;span&#39;, class_=&#39;highlight&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements_with_class:<\/p>\n<p>    print(element.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u83b7\u53d6\u884c\u5185\u5143\u7d20<\/p>\n<\/p>\n<ol>\n<li>\u57fa\u672c\u7528\u6cd5<\/li>\n<\/ol>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6587\u672c\u5339\u914d\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u67e5\u627e\u548c\u63d0\u53d6HTML\u6587\u6863\u4e2d\u7684\u884c\u5185\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<h2><strong>\u5b9a\u4e49\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f<\/strong><\/h2>\n<p>pattern = re.compile(r&#39;&lt;span.*?&gt;(.*?)&lt;\/span&gt;&#39;, re.S)<\/p>\n<h2><strong>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u627e\u884c\u5185\u5143\u7d20<\/strong><\/h2>\n<p>inline_elements = pattern.findall(html_content)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements:<\/p>\n<p>    print(element)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u63d0\u53d6\u7279\u5b9a\u5c5e\u6027\u7684\u884c\u5185\u5143\u7d20<\/li>\n<\/ol>\n<p><p>\u6b63\u5219\u8868\u8fbe\u5f0f\u8fd8\u53ef\u4ee5\u7528\u4e8e\u5339\u914d\u5177\u6709\u7279\u5b9a\u5c5e\u6027\u7684\u884c\u5185\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5b9a\u4e49\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\uff0c\u5339\u914d\u5177\u6709\u7279\u5b9a\u7c7b\u540d\u7684\u884c\u5185\u5143\u7d20<\/p>\n<p>pattern = re.compile(r&#39;&lt;span class=&quot;highlight&quot;.*?&gt;(.*?)&lt;\/span&gt;&#39;, re.S)<\/p>\n<h2><strong>\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u67e5\u627e\u884c\u5185\u5143\u7d20<\/strong><\/h2>\n<p>inline_elements = pattern.findall(html_content)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements:<\/p>\n<p>    print(element)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528Selenium\u83b7\u53d6\u884c\u5185\u5143\u7d20<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5\u548c\u57fa\u672c\u4f7f\u7528<\/li>\n<\/ol>\n<p><p>Selenium\u662f\u4e00\u4e2a\u7528\u4e8eWeb\u5e94\u7528\u7a0b\u5e8f\u6d4b\u8bd5\u7684\u81ea\u52a8\u5316\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u9a71\u52a8\u6d4f\u89c8\u5668\u6267\u884c\u5404\u79cd\u64cd\u4f5c\u3002\u5728\u9700\u8981\u52a8\u6001\u52a0\u8f7d\u5185\u5bb9\u7684\u7f51\u7ad9\u4e0a\uff0cSelenium\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5Selenium\u548c\u6d4f\u89c8\u5668\u9a71\u52a8\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8eChrome\u6d4f\u89c8\u5668\uff0c\u53ef\u4ee5\u5b89\u88c5ChromeDriver\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install selenium<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Selenium\u83b7\u53d6\u884c\u5185\u5143\u7d20<\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from selenium import webdriver<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Chrome\u6d4f\u89c8\u5668\u5b9e\u4f8b<\/strong><\/h2>\n<p>driver = webdriver.Chrome()<\/p>\n<h2><strong>\u6253\u5f00\u76ee\u6807\u7f51\u9875<\/strong><\/h2>\n<p>driver.get(&#39;http:\/\/example.com&#39;)<\/p>\n<h2><strong>\u67e5\u627e\u884c\u5185\u5143\u7d20\uff0c\u4f8b\u5982 &lt;span&gt;<\/strong><\/h2>\n<p>inline_elements = driver.find_elements_by_tag_name(&#39;span&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements:<\/p>\n<p>    print(element.text)<\/p>\n<h2><strong>\u5173\u95ed\u6d4f\u89c8\u5668<\/strong><\/h2>\n<p>driver.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u67e5\u627e\u7279\u5b9a\u5c5e\u6027\u7684\u884c\u5185\u5143\u7d20<\/li>\n<\/ol>\n<p><p>Selenium\u4e5f\u53ef\u4ee5\u901a\u8fc7CSS\u9009\u62e9\u5668\u6216XPath\u67e5\u627e\u7279\u5b9a\u5c5e\u6027\u7684\u884c\u5185\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528CSS\u9009\u62e9\u5668\u67e5\u627e\u5177\u6709\u7279\u5b9a\u7c7b\u540d\u7684\u884c\u5185\u5143\u7d20<\/p>\n<p>inline_elements_with_class = driver.find_elements_by_css_selector(&#39;span.highlight&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u884c\u5185\u5143\u7d20\u7684\u5185\u5bb9<\/strong><\/h2>\n<p>for element in inline_elements_with_class:<\/p>\n<p>    print(element.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\u83b7\u53d6\u884c\u5185\u5143\u7d20\u7684\u65b9\u6cd5\u591a\u79cd\u591a\u6837\uff0c\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5177\u4f53\u7684\u5e94\u7528\u573a\u666f\u548c\u9700\u6c42\u3002<strong>BeautifulSoup\u662f\u6700\u5e38\u7528\u7684\u5de5\u5177\uff0c\u56e0\u4e3a\u5b83\u7b80\u5355\u6613\u7528\u4e14\u529f\u80fd\u5f3a\u5927<\/strong>\uff0c\u9002\u5408\u5927\u591a\u6570\u9759\u6001\u7f51\u9875\u7684\u89e3\u6790\u4efb\u52a1\u3002\u5bf9\u4e8e\u52a8\u6001\u52a0\u8f7d\u5185\u5bb9\u7684\u7f51\u7ad9\uff0cSelenium\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\u3002\u6b63\u5219\u8868\u8fbe\u5f0f\u5219\u9002\u5408\u4e8e\u7279\u5b9a\u60c5\u51b5\u4e0b\u7684\u6587\u672c\u5339\u914d\u548c\u63d0\u53d6\u4efb\u52a1\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u9700\u8981\u6839\u636e\u5177\u4f53\u7684\u7f51\u9875\u7ed3\u6784\u548c\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u548c\u4f18\u5316\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u83b7\u53d6\u7f51\u9875\u4e2d\u7684\u884c\u5185\u5143\u7d20\uff1f<\/strong><br \/>\u8981\u83b7\u53d6\u7f51\u9875\u4e2d\u7684\u884c\u5185\u5143\u7d20\uff0c\u53ef\u4ee5\u4f7f\u7528Beautiful Soup\u5e93\u7ed3\u5408requests\u5e93\u3002\u9996\u5148\uff0c\u53d1\u9001HTTP\u8bf7\u6c42\u4ee5\u83b7\u53d6\u7f51\u9875\u5185\u5bb9\uff0c\u7136\u540e\u4f7f\u7528Beautiful Soup\u89e3\u6790HTML\u6587\u6863\uff0c\u63a5\u7740\u4f7f\u7528CSS\u9009\u62e9\u5668\u6216\u7279\u5b9a\u6807\u7b7e\u6765\u63d0\u53d6\u884c\u5185\u5143\u7d20\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>soup.find_all(&#39;span&#39;)<\/code>\u53ef\u4ee5\u83b7\u53d6\u6240\u6709\u7684<code>&lt;span&gt;<\/code>\u6807\u7b7e\uff0c\u8fd9\u4e9b\u901a\u5e38\u662f\u884c\u5185\u5143\u7d20\u3002<\/p>\n<p><strong>Python\u4e2d\u6709\u54ea\u4e9b\u5e93\u53ef\u4ee5\u5e2e\u52a9\u83b7\u53d6\u884c\u5185\u5143\u7d20\uff1f<\/strong><br \/>\u5e38\u7528\u7684\u5e93\u5305\u62ecBeautiful Soup\u548clxml\uff0c\u5b83\u4eec\u90fd\u80fd\u591f\u89e3\u6790HTML\u548cXML\u6587\u6863\u3002Beautiful Soup\u7279\u522b\u9002\u5408\u5904\u7406\u4e0d\u89c4\u5219\u7684HTML\u6587\u6863\uff0c\u800clxml\u5219\u4ee5\u5176\u901f\u5ea6\u548c\u6548\u7387\u53d7\u5230\u9752\u7750\u3002\u6b64\u5916\uff0cSelenium\u5e93\u4e5f\u53ef\u4ee5\u7528\u4e8e\u52a8\u6001\u7f51\u9875\u7684\u5143\u7d20\u63d0\u53d6\uff0c\u9002\u5408\u9700\u8981\u6a21\u62df\u6d4f\u89c8\u5668\u64cd\u4f5c\u7684\u60c5\u51b5\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u83b7\u53d6\u5230\u7684\u884c\u5185\u5143\u7d20\u6570\u636e\uff1f<\/strong><br \/>\u83b7\u53d6\u5230\u884c\u5185\u5143\u7d20\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b57\u7b26\u4e32\u65b9\u6cd5\u548c\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u548c\u5904\u7406\u3002\u4f7f\u7528Beautiful Soup\u7684<code>.text<\/code>\u5c5e\u6027\uff0c\u53ef\u4ee5\u8f7b\u677e\u63d0\u53d6\u6587\u672c\u5185\u5bb9\u3002\u5982\u679c\u9700\u8981\u8fdb\u4e00\u6b65\u5206\u6790\u6216\u5b58\u50a8\u6570\u636e\uff0c\u53ef\u4ee5\u8003\u8651\u5c06\u5176\u8f6c\u6362\u4e3aPandas DataFrame\uff0c\u65b9\u4fbf\u540e\u7eed\u7684\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u83b7\u53d6\u884c\u5185\u5143\u7d20\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528BeautifulSoup\u89e3\u6790HTML\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u3001\u4ee5\u53ca\u901a\u8fc7 [&hellip;]","protected":false},"author":3,"featured_media":981195,"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\/981185"}],"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=981185"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/981185\/revisions"}],"predecessor-version":[{"id":981198,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/981185\/revisions\/981198"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/981195"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=981185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=981185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=981185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}