{"id":921532,"date":"2024-12-26T14:14:10","date_gmt":"2024-12-26T06:14:10","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/921532.html"},"modified":"2024-12-26T14:14:12","modified_gmt":"2024-12-26T06:14:12","slug":"python%e5%a6%82%e4%bd%95%e7%88%ac%e5%8f%96%e7%bd%91%e9%a1%b5%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/921532.html","title":{"rendered":"python\u5982\u4f55\u722c\u53d6\u7f51\u9875\u6570\u636e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24210430\/0b44351d-fd94-4f9b-a4e9-12e220b96c83.webp\" alt=\"python\u5982\u4f55\u722c\u53d6\u7f51\u9875\u6570\u636e\" \/><\/p>\n<p><p> <strong>Python\u722c\u53d6\u7f51\u9875\u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5e93\u5982requests\u3001BeautifulSoup\u3001Scrapy\u7b49\uff0c\u7ed3\u5408\u6b63\u5219\u8868\u8fbe\u5f0f\u3001XPath\u7b49\u6280\u672f\u5b9e\u73b0\u3002<\/strong>\u5176\u4e2d\uff0crequests\u5e93\u7528\u4e8e\u53d1\u9001HTTP\u8bf7\u6c42\uff0c\u83b7\u53d6\u7f51\u9875\u7684HTML\u6e90\u4ee3\u7801\uff1bBeautifulSoup\u5219\u7528\u4e8e\u89e3\u6790HTML\u6587\u6863\uff0c\u63d0\u53d6\u6240\u9700\u7684\u6570\u636e\uff1bScrapy\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u722c\u866b\u6846\u67b6\uff0c\u9002\u5408\u5927\u89c4\u6a21\u6570\u636e\u722c\u53d6\u3002\u4e3a\u4e86\u63d0\u9ad8\u722c\u53d6\u6548\u7387\u548c\u7a33\u5b9a\u6027\uff0c\u4f7f\u7528\u4ee3\u7406IP\u3001\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a\u3001\u8bbe\u7f6e\u8bf7\u6c42\u5934\u7b49\u65b9\u6cd5\u662f\u5e38\u89c1\u7684\u6280\u5de7\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u5de5\u5177\u548c\u6280\u672f\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528REQUESTS\u5e93\u53d1\u9001HTTP\u8bf7\u6c42<\/h3>\n<\/p>\n<p><p>requests\u5e93\u662fPython\u4e2d\u6700\u5e38\u7528\u7684HTTP\u8bf7\u6c42\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u7b80\u5355\u6613\u7528\u7684\u63a5\u53e3\u6765\u83b7\u53d6\u7f51\u9875\u6570\u636e\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u548c\u57fa\u672c\u4f7f\u7528<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u5b89\u88c5requests\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528requests\u53d1\u9001GET\u8bf7\u6c42\u83b7\u53d6\u7f51\u9875\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>url = &quot;http:\/\/example.com&quot;<\/p>\n<p>response = requests.get(url)<\/p>\n<p>print(response.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c<code>requests.get(url)<\/code>\u8fd4\u56de\u4e00\u4e2a\u54cd\u5e94\u5bf9\u8c61\uff0c\u8be5\u5bf9\u8c61\u5305\u542b\u4e86\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6240\u6709\u4fe1\u606f\uff0c\u5305\u62ec\u7f51\u9875\u7684\u5185\u5bb9\uff08\u901a\u8fc7<code>response.text<\/code>\u83b7\u53d6\uff09\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6dfb\u52a0\u8bf7\u6c42\u5934\u548c\u53c2\u6570<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u722c\u866b\u4e2d\uff0c\u4e3a\u4e86\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a\uff0c\u901a\u5e38\u9700\u8981\u6dfb\u52a0\u8bf7\u6c42\u5934\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">headers = {<\/p>\n<p>    &quot;User-Agent&quot;: &quot;Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.3&quot;<\/p>\n<p>}<\/p>\n<p>response = requests.get(url, headers=headers)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7<code>headers<\/code>\u53c2\u6570\uff0c\u53ef\u4ee5\u4f2a\u88c5\u6210\u6d4f\u89c8\u5668\u8fdb\u884c\u8bbf\u95ee\uff0c\u907f\u514d\u88ab\u4e00\u4e9b\u7f51\u7ad9\u7684\u53cd\u722c\u866b\u673a\u5236\u8bc6\u522b\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u4f7f\u7528BEAUTIFULSOUP\u89e3\u6790HTML<\/h3>\n<\/p>\n<p><p>BeautifulSoup\u662f\u4e00\u4e2a\u7528\u4e8e\u89e3\u6790HTML\u548cXML\u6587\u6863\u7684\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u63d0\u53d6\u7f51\u9875\u4e2d\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u548c\u57fa\u672c\u4f7f\u7528<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u5b89\u88c5BeautifulSoup\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install beautifulsoup4<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u89e3\u6790HTML\u6587\u6863\u5e76\u63d0\u53d6\u6570\u636e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>html_doc = response.text<\/p>\n<p>soup = BeautifulSoup(html_doc, &#39;html.parser&#39;)<\/p>\n<h2><strong>\u63d0\u53d6\u7279\u5b9a\u6807\u7b7e\u7684\u6570\u636e<\/strong><\/h2>\n<p>title = soup.title.string<\/p>\n<p>print(f&quot;Title: {title}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4f7f\u7528\u9009\u62e9\u5668\u63d0\u53d6\u6570\u636e<\/strong><\/p>\n<\/p>\n<p><p>BeautifulSoup\u63d0\u4f9b\u4e86\u591a\u79cd\u9009\u62e9\u5668\u65b9\u6cd5\uff0c\u4f8b\u5982<code>find()<\/code>\u3001<code>find_all()<\/code>\u3001<code>select()<\/code>\u7b49\uff0c\u7528\u4e8e\u63d0\u53d6\u7279\u5b9a\u7684HTML\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u67e5\u627e\u6240\u6709\u7684&lt;a&gt;\u6807\u7b7e<\/p>\n<p>links = soup.find_all(&#39;a&#39;)<\/p>\n<p>for link in links:<\/p>\n<p>    print(link.get(&#39;href&#39;))<\/p>\n<h2><strong>\u4f7f\u7528CSS\u9009\u62e9\u5668<\/strong><\/h2>\n<p>items = soup.select(&#39;.item &gt; a&#39;)<\/p>\n<p>for item in items:<\/p>\n<p>    print(item.get_text())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4f7f\u7528SCRAPY\u8fdb\u884c\u5927\u89c4\u6a21\u6570\u636e\u722c\u53d6<\/h3>\n<\/p>\n<p><p>Scrapy\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u722c\u866b\u6846\u67b6\uff0c\u9002\u5408\u7528\u4e8e\u5927\u89c4\u6a21\u3001\u590d\u6742\u7684\u7f51\u7ad9\u6570\u636e\u722c\u53d6\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b89\u88c5\u548c\u9879\u76ee\u521b\u5efa<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u5b89\u88c5Scrapy\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install scrapy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2aScrapy\u9879\u76ee\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">scrapy startproject myproject<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b9a\u4e49\u722c\u866b<\/strong><\/p>\n<\/p>\n<p><p>\u5728Scrapy\u9879\u76ee\u4e2d\uff0c\u5b9a\u4e49\u722c\u866b\u7c7b\u7ee7\u627f\u81ea<code>scrapy.Spider<\/code>\uff0c\u5e76\u5b9e\u73b0<code>parse<\/code>\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import scrapy<\/p>\n<p>class MySpider(scrapy.Spider):<\/p>\n<p>    name = &quot;myspider&quot;<\/p>\n<p>    start_urls = [&quot;http:\/\/example.com&quot;]<\/p>\n<p>    def parse(self, response):<\/p>\n<p>        for title in response.css(&#39;title::text&#39;):<\/p>\n<p>            yield {&#39;title&#39;: title.get()}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884c\u722c\u866b<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Scrapy\u547d\u4ee4\u8fd0\u884c\u722c\u866b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">scrapy crawl myspider<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u548cXPATH\u63d0\u53d6\u6570\u636e<\/h3>\n<\/p>\n<p><p>\u5728\u722c\u866b\u8fc7\u7a0b\u4e2d\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u548cXPath\u662f\u5e38\u7528\u7684\u6570\u636e\u63d0\u53d6\u6280\u672f\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6b63\u5219\u8868\u8fbe\u5f0f<\/strong><\/p>\n<\/p>\n<p><p>Python\u7684<code>re<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>text = &quot;Contact us at contact@example.com&quot;<\/p>\n<p>match = re.search(r&#39;\\w+@\\w+\\.\\w+&#39;, text)<\/p>\n<p>if match:<\/p>\n<p>    print(f&quot;Em<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>l found: {match.group()}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>XPath<\/strong><\/p>\n<\/p>\n<p><p>XPath\u662f\u4e00\u79cd\u7528\u4e8e\u5728XML\u6587\u6863\u4e2d\u5b9a\u4f4d\u8282\u70b9\u7684\u8bed\u8a00\uff0cScrapy\u548clxml\u5e93\u90fd\u652f\u6301\u4f7f\u7528XPath\u9009\u62e9\u5668\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from lxml import etree<\/p>\n<p>tree = etree.HTML(response.text)<\/p>\n<p>title = tree.xpath(&#39;\/\/title\/text()&#39;)<\/p>\n<p>print(f&quot;Title: {title[0]}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u63d0\u9ad8\u722c\u866b\u6548\u7387\u548c\u7a33\u5b9a\u6027<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4f7f\u7528\u4ee3\u7406IP<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u722c\u53d6\u9891\u7387\u8f83\u9ad8\u7684\u7f51\u7ad9\u65f6\uff0c\u4f7f\u7528\u4ee3\u7406IP\u53ef\u4ee5\u907f\u514d\u88ab\u5c01\u7981\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">proxies = {<\/p>\n<p>    &quot;http&quot;: &quot;http:\/\/proxy.example.com:8080&quot;,<\/p>\n<p>    &quot;https&quot;: &quot;https:\/\/proxy.example.com:8080&quot;<\/p>\n<p>}<\/p>\n<p>response = requests.get(url, proxies=proxies)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a<\/strong><\/p>\n<\/p>\n<p><p>\u9664\u4e86\u8bbe\u7f6e\u8bf7\u6c42\u5934\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528Selenium\u7b49\u5de5\u5177\u6a21\u62df\u5b8c\u6574\u7684\u6d4f\u89c8\u5668\u884c\u4e3a\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from selenium import webdriver<\/p>\n<p>driver = webdriver.Chrome()<\/p>\n<p>driver.get(url)<\/p>\n<p>content = driver.page_source<\/p>\n<p>driver.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u8bf7\u6c42\u95f4\u9694<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528time.sleep()\u8bbe\u7f6e\u8bf7\u6c42\u95f4\u9694\uff0c\u907f\u514d\u8fc7\u4e8e\u9891\u7e41\u7684\u8bf7\u6c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import time<\/p>\n<p>for url in url_list:<\/p>\n<p>    response = requests.get(url)<\/p>\n<p>    time.sleep(1)  # \u6682\u505c1\u79d2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u722c\u53d6\u7f51\u9875\u6570\u636e\u662f\u4e00\u4e2a\u7efc\u5408\u5e94\u7528\u591a\u79cd\u6280\u672f\u548c\u5de5\u5177\u7684\u8fc7\u7a0b\u3002<strong>requests\u5e93\u7528\u4e8e\u53d1\u9001HTTP\u8bf7\u6c42\uff0cBeautifulSoup\u7528\u4e8e\u89e3\u6790HTML\uff0cScrapy\u9002\u5408\u5927\u89c4\u6a21\u722c\u53d6\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u548cXPath\u7528\u4e8e\u6570\u636e\u63d0\u53d6<\/strong>\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u540c\u65f6\u6ce8\u610f\u9075\u5b88\u7f51\u7ad9\u7684\u722c\u866b\u534f\u8bae\uff08robots.txt\uff09\u548c\u76f8\u5173\u6cd5\u5f8b\u6cd5\u89c4\u3002\u901a\u8fc7\u5408\u7406\u8bbe\u7f6e\u8bf7\u6c42\u5934\u3001\u4f7f\u7528\u4ee3\u7406\u3001\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a\u3001\u8bbe\u7f6e\u8bf7\u6c42\u95f4\u9694\u7b49\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u63d0\u9ad8\u722c\u866b\u7684\u6548\u7387\u548c\u7a33\u5b9a\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684Python\u5e93\u8fdb\u884c\u7f51\u9875\u6570\u636e\u722c\u53d6\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6709\u591a\u4e2a\u5e93\u53ef\u4ee5\u7528\u6765\u722c\u53d6\u7f51\u9875\u6570\u636e\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5305\u62ecRequests\u548cBeautifulSoup\u3002Requests\u5e93\u7528\u4e8e\u53d1\u9001HTTP\u8bf7\u6c42\uff0c\u83b7\u53d6\u7f51\u9875\u5185\u5bb9\uff0c\u800cBeautifulSoup\u5219\u7528\u4e8e\u89e3\u6790HTML\u548cXML\u6587\u6863\uff0c\u65b9\u4fbf\u63d0\u53d6\u6240\u9700\u7684\u6570\u636e\u3002\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u7f51\u9875\uff0cScrapy\u6846\u67b6\u63d0\u4f9b\u4e86\u66f4\u52a0\u9ad8\u6548\u7684\u722c\u866b\u89e3\u51b3\u65b9\u6848\u3002\u6839\u636e\u4f60\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\uff0c\u80fd\u591f\u63d0\u9ad8\u722c\u53d6\u6548\u7387\u548c\u6570\u636e\u5904\u7406\u80fd\u529b\u3002<\/p>\n<p><strong>\u722c\u53d6\u7f51\u9875\u6570\u636e\u65f6\u5e94\u8be5\u6ce8\u610f\u54ea\u4e9b\u6cd5\u5f8b\u548c\u9053\u5fb7\u95ee\u9898\uff1f<\/strong><br \/>\u5728\u8fdb\u884c\u7f51\u9875\u6570\u636e\u722c\u53d6\u65f6\uff0c\u9075\u5b88\u76f8\u5173\u6cd5\u5f8b\u6cd5\u89c4\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u9996\u5148\uff0c\u786e\u4fdd\u9075\u5faa\u7f51\u7ad9\u7684robots.txt\u6587\u4ef6\u4e2d\u89c4\u5b9a\u7684\u722c\u53d6\u89c4\u5219\uff0c\u5c0a\u91cd\u7f51\u7ad9\u7684\u722c\u53d6\u9650\u5236\u3002\u6b64\u5916\uff0c\u5c3d\u91cf\u907f\u514d\u5bf9\u670d\u52a1\u5668\u9020\u6210\u8d1f\u62c5\uff0c\u5408\u7406\u8bbe\u7f6e\u8bf7\u6c42\u95f4\u9694\uff0c\u9632\u6b62\u56e0\u9891\u7e41\u8bf7\u6c42\u800c\u5bfc\u81f4IP\u88ab\u5c01\u7981\u3002\u540c\u65f6\uff0c\u9075\u5faa\u6570\u636e\u4f7f\u7528\u7684\u4f26\u7406\uff0c\u786e\u4fdd\u4e0d\u4fb5\u72af\u4ed6\u4eba\u7684\u7248\u6743\u6216\u9690\u79c1\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u52a8\u6001\u7f51\u9875\u7684\u722c\u53d6\u9700\u6c42\uff1f<\/strong><br \/>\u8bb8\u591a\u73b0\u4ee3\u7f51\u7ad9\u4f7f\u7528JavaScript\u52a8\u6001\u751f\u6210\u5185\u5bb9\uff0c\u56e0\u6b64\u76f4\u63a5\u722c\u53d6HTML\u53ef\u80fd\u65e0\u6cd5\u83b7\u53d6\u6240\u9700\u6570\u636e\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528Selenium\u5e93\uff0c\u5b83\u53ef\u4ee5\u6a21\u62df\u6d4f\u89c8\u5668\u884c\u4e3a\uff0c\u52a0\u8f7dJavaScript\u5e76\u4e0e\u7f51\u9875\u8fdb\u884c\u4ea4\u4e92\u3002\u53e6\u4e00\u79cd\u9009\u62e9\u662f\u4f7f\u7528API\uff08\u5982\u679c\u7f51\u7ad9\u63d0\u4f9b\u7684\u8bdd\uff09\uff0c\u901a\u8fc7API\u8bf7\u6c42\u83b7\u53d6\u6570\u636e\u901a\u5e38\u6bd4\u722c\u53d6HTML\u66f4\u9ad8\u6548\u548c\u7a33\u5b9a\u3002\u786e\u4fdd\u4e86\u89e3\u76ee\u6807\u7f51\u7ad9\u7684\u7ed3\u6784\uff0c\u4ee5\u4fbf\u9009\u62e9\u6700\u5408\u9002\u7684\u722c\u53d6\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u722c\u53d6\u7f51\u9875\u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5e93\u5982requests\u3001BeautifulSoup\u3001Scrapy\u7b49\uff0c\u7ed3\u5408\u6b63\u5219 [&hellip;]","protected":false},"author":3,"featured_media":921533,"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\/921532"}],"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=921532"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/921532\/revisions"}],"predecessor-version":[{"id":921534,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/921532\/revisions\/921534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/921533"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=921532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=921532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=921532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}