{"id":1017455,"date":"2024-12-27T12:28:27","date_gmt":"2024-12-27T04:28:27","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1017455.html"},"modified":"2024-12-27T12:28:42","modified_gmt":"2024-12-27T04:28:42","slug":"python%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%a1%ab%e9%97%ae%e5%8d%b7","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1017455.html","title":{"rendered":"Python\u5982\u4f55\u5feb\u901f\u586b\u95ee\u5377"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25160340\/1345233a-4d70-481d-a7c9-00952813833c.webp\" alt=\"Python\u5982\u4f55\u5feb\u901f\u586b\u95ee\u5377\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c\u5feb\u901f\u586b\u95ee\u5377\u53ef\u4ee5\u901a\u8fc7<strong>\u81ea\u52a8\u5316\u811a\u672c\u7f16\u5199\u3001\u4f7f\u7528Selenium\u7b49\u81ea\u52a8\u5316\u6d4b\u8bd5\u5de5\u5177\u3001\u4ee5\u53ca\u8fdb\u884c\u9875\u9762\u5143\u7d20\u89e3\u6790<\/strong>\u6765\u5b9e\u73b0\u3002\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u4e0d\u9700\u8981\u624b\u52a8\u5e72\u9884\u7684\u60c5\u51b5\u4e0b\u81ea\u52a8\u586b\u5199\u548c\u63d0\u4ea4\u95ee\u5377\u3002<strong>\u81ea\u52a8\u5316\u811a\u672c\u7f16\u5199<\/strong>\u662f\u5176\u4e2d\u6700\u4e3a\u5e38\u7528\u7684\u65b9\u6cd5\u4e4b\u4e00\uff0c\u5b83\u5141\u8bb8\u6211\u4eec\u901a\u8fc7\u7f16\u5199\u4ee3\u7801\u6765\u6a21\u62df\u7528\u6237\u64cd\u4f5c\uff0c\u4ece\u800c\u5b9e\u73b0\u81ea\u52a8\u586b\u5199\u95ee\u5377\u7684\u76ee\u7684\u3002\u901a\u8fc7\u4f7f\u7528Python\u7f16\u5199\u81ea\u52a8\u5316\u811a\u672c\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u5730\u586b\u5199\u5927\u91cf\u95ee\u5377\uff0c\u4ece\u800c\u8282\u7701\u65f6\u95f4\u548c\u7cbe\u529b\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u81ea\u52a8\u5316\u811a\u672c\u7f16\u5199<\/h3>\n<\/p>\n<p><p>\u81ea\u52a8\u5316\u811a\u672c\u662f\u5229\u7528\u7a0b\u5e8f\u6765\u81ea\u52a8\u6267\u884c\u4e00\u7cfb\u5217\u64cd\u4f5c\u7684\u8fc7\u7a0b\u3002\u5bf9\u4e8e\u95ee\u5377\u586b\u5199\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199Python\u811a\u672c\u6765\u6a21\u62df\u7528\u6237\u7684\u64cd\u4f5c\u6b65\u9aa4\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u9002\u5f53\u7684\u5de5\u5177\u6765\u83b7\u53d6\u95ee\u5377\u9875\u9762\u7684\u7ed3\u6784\u4fe1\u606f\uff0c\u6bd4\u5982\u901a\u8fc7\u6d4f\u89c8\u5668\u7684\u5f00\u53d1\u8005\u5de5\u5177\u67e5\u770b\u95ee\u5377\u7684HTML\u4ee3\u7801\u3002\u7136\u540e\uff0c\u6839\u636e\u8fd9\u4e9b\u4fe1\u606f\u7f16\u5199Python\u811a\u672c\uff0c\u6a21\u62df\u7528\u6237\u7684\u70b9\u51fb\u3001\u8f93\u5165\u7b49\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528Requests\u5e93<\/h4>\n<\/p>\n<p><p>Requests\u5e93\u662fPython\u4e2d\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684HTTP\u5e93\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5728\u7f51\u7edc\u4e0a\u53d1\u9001\u8bf7\u6c42\u5e76\u83b7\u53d6\u54cd\u5e94\u3002\u5bf9\u4e8e\u4e00\u4e9b\u7b80\u5355\u7684\u95ee\u5377\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u53d1\u9001HTTP\u8bf7\u6c42\u76f4\u63a5\u63d0\u4ea4\u95ee\u5377\u6570\u636e\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5206\u6790\u95ee\u5377\u9875\u9762\u7684\u8bf7\u6c42\u7ed3\u6784\uff0c\u786e\u5b9a\u63d0\u4ea4\u6570\u636e\u7684URL\u4ee5\u53ca\u6570\u636e\u683c\u5f0f\u3002\u7136\u540e\uff0c\u901a\u8fc7\u7f16\u5199Python\u811a\u672c\uff0c\u4f7f\u7528Requests\u5e93\u53d1\u9001POST\u8bf7\u6c42\u5c06\u6570\u636e\u63d0\u4ea4\u5230\u670d\u52a1\u5668\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<h2><strong>URL of the form submission<\/strong><\/h2>\n<p>url = &#39;http:\/\/example.com\/submit_form&#39;<\/p>\n<h2><strong>Data to be submitted<\/strong><\/h2>\n<p>data = {<\/p>\n<p>    &#39;name&#39;: &#39;John Doe&#39;,<\/p>\n<p>    &#39;em<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>l&#39;: &#39;john.doe@example.com&#39;,<\/p>\n<p>    &#39;feedback&#39;: &#39;Great service!&#39;<\/p>\n<p>}<\/p>\n<h2><strong>Sending POST request<\/strong><\/h2>\n<p>response = requests.post(url, data=data)<\/p>\n<h2><strong>Check the response status<\/strong><\/h2>\n<p>if response.status_code == 200:<\/p>\n<p>    print(&#39;Form submitted successfully.&#39;)<\/p>\n<p>else:<\/p>\n<p>    print(&#39;Form submission failed.&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528BeautifulSoup\u89e3\u6790\u9875\u9762<\/h4>\n<\/p>\n<p><p>BeautifulSoup\u662fPython\u4e2d\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684HTML\u548cXML\u89e3\u6790\u5e93\u3002\u901a\u8fc7\u4f7f\u7528BeautifulSoup\uff0c\u6211\u4eec\u53ef\u4ee5\u89e3\u6790\u95ee\u5377\u9875\u9762\u7684HTML\u7ed3\u6784\uff0c\u63d0\u53d6\u51fa\u9700\u8981\u586b\u5199\u7684\u8868\u5355\u5143\u7d20\u4ee5\u53ca\u63d0\u4ea4\u6309\u94ae\u3002\u7ed3\u5408Requests\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u81ea\u52a8\u5316\u5730\u586b\u5199\u95ee\u5377\u5e76\u63d0\u4ea4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<p>import requests<\/p>\n<h2><strong>Fetch the form page<\/strong><\/h2>\n<p>url = &#39;http:\/\/example.com\/form_page&#39;<\/p>\n<p>response = requests.get(url)<\/p>\n<h2><strong>Parse the page content<\/strong><\/h2>\n<p>soup = BeautifulSoup(response.text, &#39;html.parser&#39;)<\/p>\n<h2><strong>Find the form fields<\/strong><\/h2>\n<p>name_field = soup.find(&#39;input&#39;, {&#39;name&#39;: &#39;name&#39;})<\/p>\n<p>email_field = soup.find(&#39;input&#39;, {&#39;name&#39;: &#39;email&#39;})<\/p>\n<p>feedback_field = soup.find(&#39;textarea&#39;, {&#39;name&#39;: &#39;feedback&#39;})<\/p>\n<h2><strong>Prepare the form data<\/strong><\/h2>\n<p>form_data = {<\/p>\n<p>    name_field[&#39;name&#39;]: &#39;John Doe&#39;,<\/p>\n<p>    email_field[&#39;name&#39;]: &#39;john.doe@example.com&#39;,<\/p>\n<p>    feedback_field[&#39;name&#39;]: &#39;Great service!&#39;<\/p>\n<p>}<\/p>\n<h2><strong>Submit the form<\/strong><\/h2>\n<p>submit_url = &#39;http:\/\/example.com\/submit_form&#39;<\/p>\n<p>submit_response = requests.post(submit_url, data=form_data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Selenium\u8fdb\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5<\/h3>\n<\/p>\n<p><p>Selenium\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u81ea\u52a8\u5316\u6d4f\u89c8\u5668\u64cd\u4f5c\u3002\u901a\u8fc7\u4f7f\u7528Selenium\uff0c\u6211\u4eec\u53ef\u4ee5\u6a21\u62df\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u7684\u64cd\u4f5c\uff0c\u5305\u62ec\u70b9\u51fb\u3001\u8f93\u5165\u3001\u63d0\u4ea4\u8868\u5355\u7b49\u3002Selenium\u652f\u6301\u591a\u79cd\u6d4f\u89c8\u5668\uff0c\u5305\u62ecChrome\u3001Firefox\u7b49\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u81ea\u52a8\u5316\u95ee\u5377\u586b\u5199\u3002<\/p>\n<\/p>\n<p><h4>1. Selenium\u73af\u5883\u642d\u5efa<\/h4>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Selenium\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b89\u88c5Selenium\u5e93\u4ee5\u53ca\u5bf9\u5e94\u7684\u6d4f\u89c8\u5668\u9a71\u52a8\u7a0b\u5e8f\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528Chrome\u6d4f\u89c8\u5668\u8fdb\u884c\u81ea\u52a8\u5316\u64cd\u4f5c\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5ChromeDriver\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Selenium\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install selenium<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5e76\u4eceChrome\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5ChromeDriver\uff0c\u5c06\u5176\u8def\u5f84\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528Selenium\u81ea\u52a8\u586b\u5199\u95ee\u5377<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528Selenium\u8fdb\u884c\u81ea\u52a8\u5316\u64cd\u4f5c\u65f6\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2aWebDriver\u5b9e\u4f8b\uff0c\u5e76\u6253\u5f00\u95ee\u5377\u9875\u9762\u3002\u7136\u540e\uff0c\u901a\u8fc7\u5b9a\u4f4d\u9875\u9762\u5143\u7d20\u7684\u65b9\u6cd5\uff0c\u627e\u5230\u9700\u8981\u586b\u5199\u7684\u8868\u5355\u5143\u7d20\uff0c\u5e76\u6a21\u62df\u7528\u6237\u8f93\u5165\u64cd\u4f5c\u3002\u6700\u540e\uff0c\u627e\u5230\u63d0\u4ea4\u6309\u94ae\u5e76\u8fdb\u884c\u70b9\u51fb\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from selenium import webdriver<\/p>\n<p>from selenium.webdriver.common.by import By<\/p>\n<p>from selenium.webdriver.common.keys import Keys<\/p>\n<h2><strong>Initialize WebDriver<\/strong><\/h2>\n<p>driver = webdriver.Chrome()<\/p>\n<h2><strong>Open the form page<\/strong><\/h2>\n<p>driver.get(&#39;http:\/\/example.com\/form_page&#39;)<\/p>\n<h2><strong>Locate form elements and fill them out<\/strong><\/h2>\n<p>name_field = driver.find_element(By.NAME, &#39;name&#39;)<\/p>\n<p>name_field.send_keys(&#39;John Doe&#39;)<\/p>\n<p>email_field = driver.find_element(By.NAME, &#39;email&#39;)<\/p>\n<p>email_field.send_keys(&#39;john.doe@example.com&#39;)<\/p>\n<p>feedback_field = driver.find_element(By.NAME, &#39;feedback&#39;)<\/p>\n<p>feedback_field.send_keys(&#39;Great service!&#39;)<\/p>\n<h2><strong>Locate and click the submit button<\/strong><\/h2>\n<p>submit_button = driver.find_element(By.NAME, &#39;submit&#39;)<\/p>\n<p>submit_button.click()<\/p>\n<h2><strong>Close the WebDriver<\/strong><\/h2>\n<p>driver.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u8fdb\u884c\u9875\u9762\u5143\u7d20\u89e3\u6790<\/h3>\n<\/p>\n<p><p>\u9875\u9762\u5143\u7d20\u89e3\u6790\u662f\u81ea\u52a8\u5316\u586b\u95ee\u5377\u7684\u5173\u952e\u6b65\u9aa4\u4e4b\u4e00\u3002\u901a\u8fc7\u89e3\u6790\u9875\u9762\u5143\u7d20\uff0c\u6211\u4eec\u53ef\u4ee5\u83b7\u53d6\u9875\u9762\u4e2d\u6240\u6709\u7684\u8868\u5355\u5143\u7d20\u53ca\u5176\u5c5e\u6027\uff0c\u4ee5\u4fbf\u4e8e\u540e\u7eed\u7684\u81ea\u52a8\u5316\u64cd\u4f5c\u3002\u5e38\u7528\u7684\u89e3\u6790\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5f00\u53d1\u8005\u5de5\u5177\u67e5\u770b\u9875\u9762\u7ed3\u6784\uff0c\u4ee5\u53ca\u4f7f\u7528Python\u5e93\u89e3\u6790HTML\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528\u6d4f\u89c8\u5668\u5f00\u53d1\u8005\u5de5\u5177<\/h4>\n<\/p>\n<p><p>\u73b0\u4ee3\u6d4f\u89c8\u5668\u90fd\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u67e5\u770b\u9875\u9762\u7684DOM\u7ed3\u6784\u3001CSS\u6837\u5f0f\u4ee5\u53caJavaScript\u4ee3\u7801\u3002\u901a\u8fc7\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u6211\u4eec\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u5230\u9700\u8981\u64cd\u4f5c\u7684\u8868\u5355\u5143\u7d20\uff0c\u67e5\u770b\u5176HTML\u4ee3\u7801\u53ca\u5c5e\u6027\u3002\u8fd9\u6837\uff0c\u6211\u4eec\u5c31\u80fd\u660e\u786e\u54ea\u4e9b\u5143\u7d20\u9700\u8981\u8fdb\u884c\u81ea\u52a8\u5316\u64cd\u4f5c\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u4ee3\u7801\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f7f\u7528Python\u5e93\u89e3\u6790HTML<\/h4>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528\u5f00\u53d1\u8005\u5de5\u5177\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528Python\u5e93\u6765\u89e3\u6790HTML\u4ee3\u7801\uff0c\u63d0\u53d6\u9875\u9762\u5143\u7d20\u4fe1\u606f\u3002BeautifulSoup\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684HTML\u89e3\u6790\u5e93\uff0c\u5b83\u652f\u6301\u591a\u79cd\u89e3\u6790\u5668\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u8f7b\u677e\u89e3\u6790\u590d\u6742\u7684HTML\u7ed3\u6784\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from bs4 import BeautifulSoup<\/p>\n<h2><strong>Sample HTML content<\/strong><\/h2>\n<p>html_content = &#39;&#39;&#39;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;form id=&quot;feedback-form&quot;&gt;<\/p>\n<p>    &lt;input type=&quot;text&quot; name=&quot;name&quot; value=&quot;John Doe&quot;&gt;<\/p>\n<p>    &lt;input type=&quot;email&quot; name=&quot;email&quot; value=&quot;john.doe@example.com&quot;&gt;<\/p>\n<p>    &lt;textarea name=&quot;feedback&quot;&gt;Great service!&lt;\/textarea&gt;<\/p>\n<p>    &lt;button type=&quot;submit&quot;&gt;Submit&lt;\/button&gt;<\/p>\n<p>&lt;\/form&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&#39;&#39;&#39;<\/p>\n<h2><strong>Parse the HTML content<\/strong><\/h2>\n<p>soup = BeautifulSoup(html_content, &#39;html.parser&#39;)<\/p>\n<h2><strong>Find and print form fields<\/strong><\/h2>\n<p>for input_field in soup.find_all(&#39;input&#39;):<\/p>\n<p>    print(f&quot;Name: {input_field[&#39;name&#39;]}, Value: {input_field[&#39;value&#39;]}&quot;)<\/p>\n<p>for textarea in soup.find_all(&#39;textarea&#39;):<\/p>\n<p>    print(f&quot;Name: {textarea[&#39;name&#39;]}, Value: {textarea.string}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u6a21\u62df\u7528\u6237\u4ea4\u4e92<\/h3>\n<\/p>\n<p><p>\u6a21\u62df\u7528\u6237\u4ea4\u4e92\u662f\u81ea\u52a8\u5316\u586b\u95ee\u5377\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002\u901a\u8fc7\u6a21\u62df\u7528\u6237\u7684\u70b9\u51fb\u3001\u8f93\u5165\u7b49\u64cd\u4f5c\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u4e0d\u9700\u8981\u624b\u52a8\u5e72\u9884\u7684\u60c5\u51b5\u4e0b\u81ea\u52a8\u5b8c\u6210\u95ee\u5377\u586b\u5199\u3002Selenium\u662f\u6a21\u62df\u7528\u6237\u4ea4\u4e92\u7684\u5229\u5668\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5b9e\u73b0\u590d\u6742\u7684\u81ea\u52a8\u5316\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b9a\u4f4d\u9875\u9762\u5143\u7d20<\/h4>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u7528\u6237\u4ea4\u4e92\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u5b9a\u4f4d\u5230\u9700\u8981\u64cd\u4f5c\u7684\u9875\u9762\u5143\u7d20\u3002Selenium\u63d0\u4f9b\u4e86\u591a\u79cd\u5b9a\u4f4d\u65b9\u6cd5\uff0c\u5305\u62ec\u901a\u8fc7ID\u3001\u540d\u79f0\u3001\u6807\u7b7e\u540d\u3001XPath\u7b49\u5b9a\u4f4d\u5143\u7d20\u3002\u901a\u8fc7\u9009\u62e9\u5408\u9002\u7684\u5b9a\u4f4d\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u7cbe\u786e\u5b9a\u4f4d\u5230\u9700\u8981\u64cd\u4f5c\u7684\u5143\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># Locate element by ID<\/p>\n<p>name_field = driver.find_element(By.ID, &#39;name&#39;)<\/p>\n<h2><strong>Locate element by name<\/strong><\/h2>\n<p>email_field = driver.find_element(By.NAME, &#39;email&#39;)<\/p>\n<h2><strong>Locate element by XPath<\/strong><\/h2>\n<p>feedback_field = driver.find_element(By.XPATH, &#39;\/\/textarea[@name=&quot;feedback&quot;]&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u6a21\u62df\u8f93\u5165\u548c\u70b9\u51fb<\/h4>\n<\/p>\n<p><p>\u5b9a\u4f4d\u5230\u9875\u9762\u5143\u7d20\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Selenium\u7684\u65b9\u6cd5\u6765\u6a21\u62df\u7528\u6237\u7684\u8f93\u5165\u548c\u70b9\u51fb\u64cd\u4f5c\u3002\u901a\u8fc7\u8c03\u7528<code>send_keys<\/code>\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5411\u8f93\u5165\u6846\u8f93\u5165\u6587\u672c\uff1b\u901a\u8fc7\u8c03\u7528<code>click<\/code>\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u6a21\u62df\u7528\u6237\u70b9\u51fb\u6309\u94ae\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># Simulate text input<\/p>\n<p>name_field.send_keys(&#39;John Doe&#39;)<\/p>\n<p>email_field.send_keys(&#39;john.doe@example.com&#39;)<\/p>\n<h2><strong>Simulate button click<\/strong><\/h2>\n<p>submit_button = driver.find_element(By.NAME, &#39;submit&#39;)<\/p>\n<p>submit_button.click()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5904\u7406\u590d\u6742\u8868\u5355<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u590d\u6742\u7684\u8868\u5355\u7ed3\u6784\uff0c\u6bd4\u5982\u591a\u6b65\u9aa4\u7684\u95ee\u5377\u3001\u52a8\u6001\u751f\u6210\u7684\u8868\u5355\u5143\u7d20\u7b49\u3002\u5904\u7406\u8fd9\u4e9b\u590d\u6742\u8868\u5355\u9700\u8981\u6211\u4eec\u5177\u5907\u4e00\u5b9a\u7684\u7075\u6d3b\u6027\u548c\u9002\u5e94\u80fd\u529b\uff0c\u4ee5\u4fbf\u4e8e\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574\u81ea\u52a8\u5316\u811a\u672c\u3002<\/p>\n<\/p>\n<p><h4>1. \u591a\u6b65\u9aa4\u95ee\u5377\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u591a\u6b65\u9aa4\u95ee\u5377\u901a\u5e38\u9700\u8981\u7528\u6237\u5728\u5b8c\u6210\u4e00\u4e2a\u6b65\u9aa4\u540e\u70b9\u51fb\u201c\u4e0b\u4e00\u6b65\u201d\u6309\u94ae\u8fdb\u5165\u4e0b\u4e00\u4e2a\u6b65\u9aa4\u3002\u5bf9\u4e8e\u8fd9\u6837\u7684\u95ee\u5377\uff0c\u6211\u4eec\u9700\u8981\u5728\u6bcf\u4e00\u6b65\u5b8c\u6210\u540e\uff0c\u6a21\u62df\u70b9\u51fb\u201c\u4e0b\u4e00\u6b65\u201d\u6309\u94ae\uff0c\u5e76\u7b49\u5f85\u9875\u9762\u52a0\u8f7d\u5b8c\u6210\u540e\u7ee7\u7eed\u586b\u5199\u4e0b\u4e00\u6b65\u7684\u8868\u5355\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># Fill out first step<\/p>\n<p>name_field = driver.find_element(By.NAME, &#39;name&#39;)<\/p>\n<p>name_field.send_keys(&#39;John Doe&#39;)<\/p>\n<p>next_button = driver.find_element(By.NAME, &#39;next&#39;)<\/p>\n<p>next_button.click()<\/p>\n<h2><strong>Wait for next step to load<\/strong><\/h2>\n<p>driver.implicitly_wait(10)<\/p>\n<h2><strong>Fill out second step<\/strong><\/h2>\n<p>email_field = driver.find_element(By.NAME, &#39;email&#39;)<\/p>\n<p>email_field.send_keys(&#39;john.doe@example.com&#39;)<\/p>\n<p>submit_button = driver.find_element(By.NAME, &#39;submit&#39;)<\/p>\n<p>submit_button.click()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u52a8\u6001\u751f\u6210\u8868\u5355\u5143\u7d20\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u4e00\u4e9b\u95ee\u5377\u53ef\u80fd\u4f1a\u6839\u636e\u7528\u6237\u7684\u9009\u62e9\u52a8\u6001\u751f\u6210\u65b0\u7684\u8868\u5355\u5143\u7d20\u3002\u5bf9\u4e8e\u8fd9\u6837\u7684\u95ee\u5377\uff0c\u6211\u4eec\u9700\u8981\u5728\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u4e0d\u65ad\u76d1\u6d4b\u9875\u9762\u53d8\u5316\uff0c\u5e76\u6839\u636e\u65b0\u7684\u8868\u5355\u5143\u7d20\u8fdb\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># Initial form filling<\/p>\n<p>option = driver.find_element(By.NAME, &#39;option&#39;)<\/p>\n<p>option.click()<\/p>\n<h2><strong>Monitor for new elements<\/strong><\/h2>\n<p>driver.implicitly_wait(10)<\/p>\n<h2><strong>Check if new element appeared and interact with it<\/strong><\/h2>\n<p>new_field = driver.find_element(By.NAME, &#39;new_field&#39;)<\/p>\n<p>if new_field:<\/p>\n<p>    new_field.send_keys(&#39;Additional info&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u63d0\u9ad8\u81ea\u52a8\u5316\u6548\u7387<\/h3>\n<\/p>\n<p><p>\u63d0\u9ad8\u81ea\u52a8\u5316\u6548\u7387\u662f\u5b9e\u73b0\u5feb\u901f\u586b\u95ee\u5377\u7684\u5173\u952e\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f18\u5316\u4ee3\u7801\u7ed3\u6784\u3001\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u7b49\u5f85\u65f6\u95f4\u4ee5\u53ca\u5e76\u884c\u5316\u64cd\u4f5c\u7b49\u65b9\u5f0f\u6765\u63d0\u5347\u81ea\u52a8\u5316\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f18\u5316\u4ee3\u7801\u7ed3\u6784<\/h4>\n<\/p>\n<p><p>\u826f\u597d\u7684\u4ee3\u7801\u7ed3\u6784\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002\u901a\u8fc7\u5c06\u91cd\u590d\u7684\u64cd\u4f5c\u5c01\u88c5\u6210\u51fd\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u51cf\u5c11\u4ee3\u7801\u5197\u4f59\uff0c\u63d0\u9ad8\u4ee3\u7801\u7684\u590d\u7528\u6027\u3002\u6b64\u5916\uff0c\u5408\u7406\u4f7f\u7528\u5f02\u5e38\u5904\u7406\u673a\u5236\uff0c\u53ef\u4ee5\u63d0\u9ad8\u811a\u672c\u7684\u9c81\u68d2\u6027\uff0c\u907f\u514d\u56e0\u610f\u5916\u9519\u8bef\u5bfc\u81f4\u81ea\u52a8\u5316\u8fc7\u7a0b\u4e2d\u65ad\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def fill_text_field(driver, field_name, value):<\/p>\n<p>    field = driver.find_element(By.NAME, field_name)<\/p>\n<p>    field.send_keys(value)<\/p>\n<p>def click_button(driver, button_name):<\/p>\n<p>    button = driver.find_element(By.NAME, button_name)<\/p>\n<p>    button.click()<\/p>\n<h2><strong>Usage<\/strong><\/h2>\n<p>fill_text_field(driver, &#39;name&#39;, &#39;John Doe&#39;)<\/p>\n<p>click_button(driver, &#39;submit&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u51cf\u5c11\u7b49\u5f85\u65f6\u95f4<\/h4>\n<\/p>\n<p><p>\u5728\u81ea\u52a8\u5316\u8fc7\u7a0b\u4e2d\uff0c\u7b49\u5f85\u65f6\u95f4\u662f\u5f71\u54cd\u6548\u7387\u7684\u91cd\u8981\u56e0\u7d20\u3002\u901a\u8fc7\u5408\u7406\u8bbe\u7f6e\u7b49\u5f85\u65f6\u95f4\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u4fdd\u8bc1\u64cd\u4f5c\u51c6\u786e\u6027\u7684\u540c\u65f6\uff0c\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u7b49\u5f85\u3002\u5728Selenium\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u663e\u5f0f\u7b49\u5f85\u548c\u9690\u5f0f\u7b49\u5f85\u6765\u63a7\u5236\u7b49\u5f85\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from selenium.webdriver.support.ui import WebDriverWait<\/p>\n<p>from selenium.webdriver.support import expected_conditions as EC<\/p>\n<h2><strong>Explicit wait<\/strong><\/h2>\n<p>element = WebDriverWait(driver, 10).until(<\/p>\n<p>    EC.presence_of_element_located((By.NAME, &#39;submit&#39;))<\/p>\n<p>)<\/p>\n<h2><strong>Implicit wait<\/strong><\/h2>\n<p>driver.implicitly_wait(10)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u5e76\u884c\u5316\u64cd\u4f5c<\/h4>\n<\/p>\n<p><p>\u5bf9\u4e8e\u9700\u8981\u586b\u5199\u5927\u91cf\u95ee\u5377\u7684\u573a\u666f\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5e76\u884c\u5316\u64cd\u4f5c\u6765\u63d0\u9ad8\u6548\u7387\u3002\u901a\u8fc7\u4f7f\u7528\u591a\u7ebf\u7a0b\u6216\u591a\u8fdb\u7a0b\u6280\u672f\uff0c\u6211\u4eec\u53ef\u4ee5\u540c\u65f6\u8fd0\u884c\u591a\u4e2a\u81ea\u52a8\u5316\u811a\u672c\uff0c\u8fdb\u4e00\u6b65\u52a0\u5feb\u95ee\u5377\u586b\u5199\u901f\u5ea6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from concurrent.futures import ThreadPoolExecutor<\/p>\n<p>def fill_questionnaire(index):<\/p>\n<p>    # Initialize WebDriver and perform operations<\/p>\n<p>    driver = webdriver.Chrome()<\/p>\n<p>    # ... perform operations ...<\/p>\n<p>    driver.quit()<\/p>\n<h2><strong>Use ThreadPoolExecutor to parallelize<\/strong><\/h2>\n<p>with ThreadPoolExecutor(max_workers=5) as executor:<\/p>\n<p>    for i in range(10):  # Assuming 10 questionnaires<\/p>\n<p>        executor.submit(fill_questionnaire, i)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u6d4b\u8bd5\u4e0e\u8c03\u8bd5<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u73b0\u81ea\u52a8\u5316\u586b\u95ee\u5377\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6d4b\u8bd5\u4e0e\u8c03\u8bd5\u662f\u786e\u4fdd\u811a\u672c\u6b63\u786e\u6027\u548c\u7a33\u5b9a\u6027\u7684\u91cd\u8981\u73af\u8282\u3002\u901a\u8fc7\u5408\u7406\u7684\u6d4b\u8bd5\u4e0e\u8c03\u8bd5\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\u5e76\u89e3\u51b3\u6f5c\u5728\u7684\u95ee\u9898\uff0c\u63d0\u9ad8\u811a\u672c\u7684\u53ef\u9760\u6027\u3002<\/p>\n<\/p>\n<p><h4>1. \u6d4b\u8bd5\u811a\u672c\u529f\u80fd<\/h4>\n<\/p>\n<p><p>\u5728\u7f16\u5199\u5b8c\u81ea\u52a8\u5316\u811a\u672c\u540e\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u5176\u529f\u80fd\u8fdb\u884c\u5168\u9762\u6d4b\u8bd5\u3002\u901a\u8fc7\u5728\u4e0d\u540c\u7684\u73af\u5883\u3001\u4e0d\u540c\u7684\u95ee\u5377\u9875\u9762\u4e0a\u8fd0\u884c\u811a\u672c\uff0c\u6211\u4eec\u53ef\u4ee5\u9a8c\u8bc1\u5176\u9002\u7528\u6027\u548c\u7a33\u5b9a\u6027\u3002\u5bf9\u4e8e\u4e00\u4e9b\u590d\u6742\u7684\u573a\u666f\uff0c\u6211\u4eec\u53ef\u4ee5\u8bbe\u8ba1\u7279\u5b9a\u7684\u6d4b\u8bd5\u7528\u4f8b\uff0c\u786e\u4fdd\u811a\u672c\u80fd\u591f\u6b63\u786e\u5904\u7406\u5404\u79cd\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h4>2. \u8c03\u8bd5\u811a\u672c\u95ee\u9898<\/h4>\n<\/p>\n<p><p>\u5728\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u95ee\u9898\uff0c\u6bd4\u5982\u5b9a\u4f4d\u4e0d\u5230\u5143\u7d20\u3001\u9875\u9762\u52a0\u8f7d\u8d85\u65f6\u7b49\u3002\u5bf9\u4e8e\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8c03\u8bd5\u5de5\u5177\u8fdb\u884c\u5206\u6790\u3002Selenium\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u65e5\u5fd7\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u4e86\u89e3\u811a\u672c\u7684\u6267\u884c\u8fc7\u7a0b\uff0c\u5e76\u5b9a\u4f4d\u95ee\u9898\u6240\u5728\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># Enable logging<\/p>\n<p>import logging<\/p>\n<p>logging.basicConfig(level=logging.DEBUG)<\/p>\n<h2><strong>Example debug log<\/strong><\/h2>\n<p>logging.debug(&quot;Starting form submission&quot;)<\/p>\n<p>try:<\/p>\n<p>    # Perform operations<\/p>\n<p>    pass<\/p>\n<p>except Exception as e:<\/p>\n<p>    logging.error(&quot;An error occurred: %s&quot;, e)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u603b\u7ed3\u4e0e\u5c55\u671b<\/h3>\n<\/p>\n<p><p>\u81ea\u52a8\u5316\u586b\u95ee\u5377\u662f\u4e00\u4e2a\u590d\u6742\u4e14\u591a\u53d8\u7684\u8fc7\u7a0b\uff0c\u9700\u8981\u6211\u4eec\u5177\u5907\u4e00\u5b9a\u7684\u7f16\u7a0b\u80fd\u529b\u548c\u95ee\u9898\u89e3\u51b3\u80fd\u529b\u3002\u901a\u8fc7\u5408\u7406\u4f7f\u7528Python\u5de5\u5177\u548c\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u5b9e\u73b0\u9ad8\u6548\u7684\u81ea\u52a8\u5316\u586b\u95ee\u5377\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002\u5728\u672a\u6765\uff0c\u968f\u7740\u6280\u672f\u7684\u4e0d\u65ad\u53d1\u5c55\uff0c\u6211\u4eec\u53ef\u4ee5\u671f\u5f85\u66f4\u591a\u81ea\u52a8\u5316\u5de5\u5177\u7684\u51fa\u73b0\uff0c\u8fdb\u4e00\u6b65\u7b80\u5316\u548c\u4f18\u5316\u81ea\u52a8\u5316\u586b\u95ee\u5377\u7684\u8fc7\u7a0b\u3002\u65e0\u8bba\u662f\u4f7f\u7528Selenium\u8fd9\u6837\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u5de5\u5177\uff0c\u8fd8\u662f\u901a\u8fc7\u7f16\u5199\u81ea\u5b9a\u4e49\u811a\u672c\uff0c\u6211\u4eec\u90fd\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u9009\u62e9\u9002\u5408\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u5feb\u901f\u586b\u95ee\u5377\u7684\u76ee\u6807\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u81ea\u52a8\u5316\u586b\u95ee\u5377\u7684\u8fc7\u7a0b\uff1f<\/strong><br \/>\u4f7f\u7528Python\u81ea\u52a8\u5316\u586b\u95ee\u5377\u901a\u5e38\u6d89\u53ca\u5230\u4f7f\u7528\u5e93\u5982Selenium\u6216Requests\u3002Selenium\u53ef\u4ee5\u6a21\u62df\u7528\u6237\u5728\u6d4f\u89c8\u5668\u4e2d\u7684\u884c\u4e3a\uff0c\u9002\u5408\u4e8e\u590d\u6742\u7684\u52a8\u6001\u7f51\u7ad9\uff0c\u800cRequests\u5219\u9002\u7528\u4e8e\u7b80\u5355\u7684\u8868\u5355\u63d0\u4ea4\u3002\u4f60\u9700\u8981\u4e86\u89e3\u95ee\u5377\u7684\u7ed3\u6784\u548c\u5b57\u6bb5\uff0c\u7136\u540e\u7f16\u5199\u811a\u672c\u6765\u586b\u5145\u8fd9\u4e9b\u5b57\u6bb5\u5e76\u63d0\u4ea4\u3002<\/p>\n<p><strong>\u662f\u5426\u9700\u8981\u7f16\u7a0b\u57fa\u7840\u624d\u80fd\u4f7f\u7528Python\u586b\u95ee\u5377\uff1f<\/strong><br \/>\u867d\u7136\u6709\u4e00\u5b9a\u7684\u7f16\u7a0b\u57fa\u7840\u4f1a\u4f7f\u64cd\u4f5c\u66f4\u52a0\u987a\u5229\uff0c\u4f46\u5e76\u4e0d\u662f\u7edd\u5bf9\u5fc5\u8981\u3002\u5f88\u591a\u5728\u7ebf\u8d44\u6e90\u548c\u6559\u7a0b\u53ef\u4ee5\u5e2e\u52a9\u521d\u5b66\u8005\u7406\u89e3\u57fa\u672c\u7684Python\u8bed\u6cd5\u548c\u5e93\u7684\u4f7f\u7528\u3002\u901a\u8fc7\u5b9e\u8df5\uff0c\u4f60\u53ef\u4ee5\u9010\u6e10\u638c\u63e1\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u95ee\u5377\u81ea\u52a8\u586b\u5199\u3002<\/p>\n<p><strong>Python\u586b\u95ee\u5377\u7684\u6700\u4f73\u5e93\u63a8\u8350\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u5bf9\u4e8eWeb\u81ea\u52a8\u5316\u586b\u95ee\u5377\uff0cSelenium\u662f\u6700\u5e38\u7528\u7684\u5e93\uff0c\u56e0\u4e3a\u5b83\u80fd\u591f\u5904\u7406JavaScript\u751f\u6210\u7684\u5185\u5bb9\u548c\u590d\u6742\u7684\u7528\u6237\u4ea4\u4e92\u3002\u5982\u679c\u95ee\u5377\u662f\u9759\u6001\u7684\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528Requests\u5e93\u8fdb\u884c\u7b80\u5355\u7684HTTP\u8bf7\u6c42\u3002\u6b64\u5916\uff0cBeautifulSoup\u53ef\u4ee5\u5e2e\u52a9\u4f60\u89e3\u6790HTML\u5e76\u63d0\u53d6\u6240\u9700\u7684\u4fe1\u606f\u3002\u6839\u636e\u4f60\u7684\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\u5c06\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u5feb\u901f\u586b\u95ee\u5377\u53ef\u4ee5\u901a\u8fc7\u81ea\u52a8\u5316\u811a\u672c\u7f16\u5199\u3001\u4f7f\u7528Selenium\u7b49\u81ea\u52a8\u5316\u6d4b\u8bd5\u5de5\u5177\u3001\u4ee5\u53ca\u8fdb\u884c\u9875\u9762\u5143\u7d20\u89e3\u6790 [&hellip;]","protected":false},"author":3,"featured_media":1017481,"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\/1017455"}],"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=1017455"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1017455\/revisions"}],"predecessor-version":[{"id":1017482,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1017455\/revisions\/1017482"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1017481"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1017455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1017455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1017455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}