{"id":182,"date":"2025-12-24T10:03:52","date_gmt":"2025-12-24T02:03:52","guid":{"rendered":"https:\/\/blog.muyou.wiki\/?p=182"},"modified":"2025-12-24T10:04:32","modified_gmt":"2025-12-24T02:04:32","slug":"%e6%8a%96%e9%9f%b3%ef%bc%8c%e5%bf%ab%e6%89%8b%ef%bc%8c%e5%b0%8f%e7%ba%a2%e4%b9%a6%e8%87%aa%e5%8a%a8%e5%8c%96%e5%8f%91%e5%b8%83","status":"publish","type":"post","link":"https:\/\/blog.muyou.wiki\/index.php\/2025\/12\/24\/%e6%8a%96%e9%9f%b3%ef%bc%8c%e5%bf%ab%e6%89%8b%ef%bc%8c%e5%b0%8f%e7%ba%a2%e4%b9%a6%e8%87%aa%e5%8a%a8%e5%8c%96%e5%8f%91%e5%b8%83\/","title":{"rendered":"\u6296\u97f3\uff0c\u5feb\u624b\uff0c\u5c0f\u7ea2\u4e66\u81ea\u52a8\u5316\u53d1\u5e03"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6b64\u7a0b\u5e8f\u4e3aPython\u5236\u4f5c \u4f7f\u7528selenium\u6a21\u62df\u7528\u6237\u70b9\u51fb\u7f51\u9875<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/blog.muyou.wiki\/wp-content\/uploads\/2025\/12\/image-1024x601.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"601\" data-original=\"https:\/\/blog.muyou.wiki\/wp-content\/uploads\/2025\/12\/image-1024x601.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-184\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u4eba\u8fd0\u884c\u73af\u5883\u4e3am\u7cfb\u5217mac<br>\u672a\u5c1d\u8bd5\u79fb\u690dwindows<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e09\u5bb6\u90fd\u662f\u901a\u8fc7\u521b\u4f5c\u8005\u4e2d\u5fc3\u7c7b\u4f3c\u7684\u5e73\u53f0\u53d1\u5e03 <br>\u8fd9\u662f\u4e00\u4e2a\u5e94\u4ed8\u715e\u7b14\u8001\u677f\u8ba9\u4e00\u5929\u53d1200\u6761\u89c6\u9891\u51fa\u6765\u7684\u4ea7\u7269 \u4e5f\u662f\u7b2c\u4e00\u6b21\u77e5\u9053\u6bcf\u4e2a\u5e73\u53f0\u4e00\u5929\u53d1\u7684\u89c6\u9891\u662f\u6709\u4e0a\u9650\u7684<br>\u8fd9\u4e09\u5bb6\u7f51\u7ad9\u7684\u67b6\u6784\u5927\u5dee\u4e0d\u5dee \uff0c\u5143\u7d20\u4e4b\u95f4\u7684\u5b9a\u4f4d\u90fd\u5dee\u4e0d\u591a <br>\u672c\u6765\u8fd8\u60f3\u5199\u89c6\u9891\u53f7 \u4f46\u65e0\u6cd5\u5b9a\u4f4d\u5143\u7d20 \u817e\u8baf\u8fd8\u662f\u6709\u70b9\u624b\u5b50\u7684<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6296\u97f3<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>from selenium import webdriver\nfrom selenium.webdriver.edge.service import Service\nfrom selenium.webdriver.common.by import By\nfrom selenium.common.exceptions import NoSuchElementException\nfrom selenium.webdriver.edge.options import Options\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nimport time\nimport random\n\n\n# \u521b\u5efa Edge Options \u5bf9\u8c61\noptions = Options()\n\n# \u8bbe\u7f6e\u6d4f\u89c8\u5668\u542f\u52a8\u53c2\u6570\uff0c\u5173\u95ed\u4e0d\u5fc5\u8981\u7684\u65e5\u5fd7\noptions.add_argument('--disable-logging')  # \u7981\u7528\u6240\u6709\u65e5\u5fd7\noptions.add_argument('--log-level=3')      # \u4ec5\u663e\u793a\u9519\u8bef\u65e5\u5fd7\noptions.add_argument('--ignore-certificate-errors')  # \u5ffd\u7565SSL\u8bc1\u4e66\u9519\u8bef\noptions.add_argument('--ignore-ssl-errors=yes')      # \u5ffd\u7565SSL\u9519\u8bef\n\n#\u5b9a\u4e49\u6d4f\u89c8\u5668\u9a71\u52a8\nwd = webdriver.Edge()\n\n#\u6253\u5f00\u7f51\u9875\nwd.get('https:\/\/creator.douyin.com\/creator-micro\/home')\n\nprint(\"\u8bf7\u626b\u7801\u767b\u5f55\u6296\u97f3\u521b\u4f5c\u8005\u4e2d\u5fc3...\")\n\n# \u7b49\u5f85\u767b\u5f55\u5b8c\u6210\uff08\u51fa\u73b0\u53d1\u5e03\u6309\u94ae\uff09\nWebDriverWait(wd, 300).until(\n    EC.presence_of_element_located(\n        (By.XPATH, \"\/html\/body\/div&#91;1]\/div&#91;1]\/aside\/div\/div\/div\/div\/div&#91;1]\/div\/div\/div\/button\")  # \u53d1\u5e03\u6309\u94ae\n    )\n)\n\nprint(\"\u767b\u5f55\u6210\u529f\")\nimport os\nimport time\n\nVIDEO_DIR = \"\/Users\/yuanningmuyou\/PycharmProjects\/\u81ea\u52a8\u5316\/shipin\/\"\nVIDEO_EXTS = (\".mp4\", \".mov\", \".avi\", \".mkv\")\n\nwhile True:\n    # \u83b7\u53d6\u6587\u4ef6\u5939\u4e2d\u6240\u6709\u89c6\u9891\n    videos = &#91;f for f in os.listdir(VIDEO_DIR) if f.lower().endswith(VIDEO_EXTS)]\n\n    # \u6587\u4ef6\u5939\u7a7a\u4e86\u5c31\u9000\u51fa\n    if not videos:\n        print(\"\u89c6\u9891\u5df2\u5168\u90e8\u5904\u7406\u5b8c\u6210\uff01\")\n        break\n\n    # \u53d6\u7b2c\u4e00\u4e2a\u89c6\u9891\n    video_file = videos&#91;0]\n    video_path = os.path.join(VIDEO_DIR, video_file)\n    print(\"\u51c6\u5907\u5904\u7406\u89c6\u9891\uff1a\", video_path)\n\n    # \u53d1\u5e03\u9875\u9762\n    wd.get('https:\/\/creator.douyin.com\/creator-micro\/content\/upload')\n\n    # \u4e0a\u4f20\u6587\u4ef6\n    input_element = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH, \"\/\/input&#91;@type='file']\")\n        )\n    )\n    import os\n\n    VIDEO_DIR = \"\/Users\/yuanningmuyou\/PycharmProjects\/\u81ea\u52a8\u5316\/shipin\/\"\n    VIDEO_EXTS = (\".mp4\", \".mov\", \".avi\", \".mkv\")\n\n    videos = &#91;\n        os.path.join(VIDEO_DIR, f)\n        for f in os.listdir(VIDEO_DIR)\n        if f.lower().endswith(VIDEO_EXTS)\n    ]\n\n    if not videos:\n        raise Exception(\"\u89c6\u9891\u6587\u4ef6\u5939\u4e2d\u6ca1\u6709\u53ef\u4e0a\u4f20\u7684\u89c6\u9891\")\n\n    video_path = random.choice(videos)\n    print(\"\u51c6\u5907\u4e0a\u4f20\u89c6\u9891\uff1a\", video_path)\n\n    # \u4e0a\u4f20\u89c6\u9891\n    input_element.send_keys(video_path)\n    print(\"\u89c6\u9891\u5df2\u9009\u62e9\uff0c\u5f00\u59cb\u4e0a\u4f20...\")\n\n    desc_div = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH, \"\/\/*&#91;@id='DCPF']\/\/div&#91;@contenteditable='true']\")\n        )\n    )\n\n    success_msg = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH,\n             \"\/html\/body\/div&#91;1]\/div&#91;1]\/div\/div&#91;3]\/div\/div\/div\/div&#91;2]\/div\/div\/div\/div\/div&#91;2]\/div&#91;1]\/div\/div&#91;2]\/div&#91;1]\/div\/div&#91;1]\/div&#91;1]\")\n        )\n    )\n\n    print(\"\u89c6\u9891\u4e0a\u4f20\u6210\u529f\uff01\")\n\n    desc_div.click()\n    desc_div.send_keys(\"\u5929\u7136\u690d\u7269\uff0c\u6ca1\u6709\u9ed1\u79d1\u6280\uff0c\u65e0\u6dfb\u52a0\")\n\n    # \u53d1\u5e03\n    element = wd.find_element(By.XPATH,\n                              \"\/html\/body\/div&#91;1]\/div&#91;1]\/div\/div&#91;3]\/div\/div\/div\/div&#91;2]\/div\/div\/div\/div\/div&#91;1]\/div\/div&#91;5]\/div\/div\/div\/div\/div\/span\/button\")\n    element.click()\n\n    os.remove(video_path)\n    print(\"\u5df2\u5220\u9664\u672c\u5730\u89c6\u9891\uff1a\", video_path)\n\n    # \u53ef\u4ee5\u52a0\u77ed\u6682\u5ef6\u8fdf\n    time.sleep(2)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5feb\u624b<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>from selenium import webdriver\nfrom selenium.webdriver.edge.service import Service\nfrom selenium.webdriver.common.by import By\nfrom selenium.common.exceptions import NoSuchElementException\nfrom selenium.webdriver.edge.options import Options\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nimport time\nimport random\n\n# \u521b\u5efa Edge Options \u5bf9\u8c61\noptions = Options()\n\n# \u8bbe\u7f6e\u6d4f\u89c8\u5668\u542f\u52a8\u53c2\u6570\uff0c\u5173\u95ed\u4e0d\u5fc5\u8981\u7684\u65e5\u5fd7\noptions.add_argument('--disable-logging')  # \u7981\u7528\u6240\u6709\u65e5\u5fd7\noptions.add_argument('--log-level=3')  # \u4ec5\u663e\u793a\u9519\u8bef\u65e5\u5fd7\noptions.add_argument('--ignore-certificate-errors')  # \u5ffd\u7565SSL\u8bc1\u4e66\u9519\u8bef\noptions.add_argument('--ignore-ssl-errors=yes')  # \u5ffd\u7565SSL\u9519\u8bef\n\n# \u5b9a\u4e49\u6d4f\u89c8\u5668\u9a71\u52a8\nwd = webdriver.Edge()\n\n# \u6253\u5f00\u7f51\u9875\nwd.get('https:\/\/passport.kuaishou.com\/pc\/account\/login\/?sid=kuaishou.web.cp.api&amp;callback=https%3A%2F%2Fcp.kuaishou.com%2Frest%2Finfra%2Fsts%3FfollowUrl%3Dhttps%253A%252F%252Fcp.kuaishou.com%252Fprofile%26setRootDomain%3Dtrue')\n\nprint(\"\u8bf7\u626b\u7801\u767b\u5f55...\")\n\n# \u7b49\u5f85\u767b\u5f55\u5b8c\u6210\uff08\u51fa\u73b0\u53d1\u5e03\u6309\u94ae\uff09\nWebDriverWait(wd, 300).until(\n    EC.presence_of_element_located(\n        (By.XPATH, \"\/html\/body\/div&#91;1]\/div&#91;1]\/div&#91;1]\/div\/section\/ul\/div&#91;1]\/div\")  # \u6587\u672c\n    )\n)\n\nprint(\"\u767b\u5f55\u6210\u529f\")\nimport os\nimport time\n\nVIDEO_DIR = \"\/Users\/yuanningmuyou\/PycharmProjects\/\u81ea\u52a8\u5316\/shipin\/\"\nVIDEO_EXTS = (\".mp4\", \".mov\", \".avi\", \".mkv\")\n\nwhile True:\n    # \u83b7\u53d6\u6587\u4ef6\u5939\u4e2d\u6240\u6709\u89c6\u9891\n    videos = &#91;f for f in os.listdir(VIDEO_DIR) if f.lower().endswith(VIDEO_EXTS)]\n\n    # \u6587\u4ef6\u5939\u7a7a\u4e86\u5c31\u9000\u51fa\n    if not videos:\n        print(\"\u89c6\u9891\u5df2\u5168\u90e8\u5904\u7406\u5b8c\u6210\uff01\")\n        break\n\n    # \u53d6\u7b2c\u4e00\u4e2a\u89c6\u9891\n    video_file = videos&#91;0]\n    video_path = os.path.join(VIDEO_DIR, video_file)\n    print(\"\u51c6\u5907\u5904\u7406\u89c6\u9891\uff1a\", video_path)\n\n    # \u53d1\u5e03\u9875\u9762\n    wd.get('https:\/\/cp.kuaishou.com\/article\/publish\/video')\n\n    # \u4e0a\u4f20\u6587\u4ef6\n    input_element = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH, \"\/\/input&#91;@type='file']\")\n        )\n    )\n    import os\n\n    VIDEO_DIR = \"\/Users\/yuanningmuyou\/PycharmProjects\/\u81ea\u52a8\u5316\/shipin\/\"\n    VIDEO_EXTS = (\".mp4\", \".mov\", \".avi\", \".mkv\")\n\n    videos = &#91;\n        os.path.join(VIDEO_DIR, f)\n        for f in os.listdir(VIDEO_DIR)\n        if f.lower().endswith(VIDEO_EXTS)\n    ]\n\n    if not videos:\n        raise Exception(\"\u89c6\u9891\u6587\u4ef6\u5939\u4e2d\u6ca1\u6709\u53ef\u4e0a\u4f20\u7684\u89c6\u9891\")\n\n    video_path = random.choice(videos)\n    print(\"\u51c6\u5907\u4e0a\u4f20\u89c6\u9891\uff1a\", video_path)\n\n    # \u4e0a\u4f20\u89c6\u9891\n    input_element.send_keys(video_path)\n    print(\"\u89c6\u9891\u5df2\u9009\u62e9\uff0c\u5f00\u59cb\u4e0a\u4f20...\")\n\n    desc_div = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH, \"\/\/*&#91;@id='work-description-edit']\")\n        )\n    )\n\n    success_msg = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH,\n             \"\/html\/body\/div&#91;1]\/div&#91;1]\/div&#91;1]\/main\/div\/div\/div&#91;1]\/div\/div\/haploid-html\/haploid-body\/div\/div\/div\/div\/div&#91;1]\/div\/main\/div&#91;2]\/div&#91;2]\/div&#91;2]\/main\/section&#91;1]\/div\/div&#91;2]\/video\")\n        )\n    )\n\n    print(\"\u89c6\u9891\u4e0a\u4f20\u6210\u529f\uff01\")\n\n    # \u68c0\u67e5\u662f\u5426\u6709\u65b0\u624b\u5f15\u5bfc\n    guide_elements = wd.find_elements(By.XPATH, \"\/html\/body\/div&#91;4]\/div\/div\/div&#91;1]\/div&#91;2]\")\n\n    if guide_elements:\n        # \u65b0\u624b\u5f15\u5bfc\u5b58\u5728\uff0c\u70b9\u51fb\u5173\u95ed\n        guide_elements&#91;0].click()\n        print(\"\u5df2\u5173\u95ed\u65b0\u624b\u5f15\u5bfc\")\n    else:\n        print(\"\u6ca1\u6709\u65b0\u624b\u5f15\u5bfc\uff0c\u7ee7\u7eed\u6267\u884c\")\n    desc_div.click()\n    desc_div.send_keys(\"\u5929\u7136\u690d\u7269\uff0c\u6ca1\u6709\u9ed1\u79d1\u6280\uff0c\u65e0\u6dfb\u52a0\")\n\n    # \u53d1\u5e03\n    element = wd.find_element(By.XPATH,\n                              \"\/html\/body\/div&#91;1]\/div&#91;1]\/div&#91;1]\/main\/div\/div\/div&#91;1]\/div\/div\/haploid-html\/haploid-body\/div\/div\/div\/div\/div&#91;1]\/div\/main\/div&#91;2]\/div&#91;2]\/div&#91;1]\/div&#91;6]\/div&#91;1]\")\n    element.click()\n\n    os.remove(video_path)\n    print(\"\u5df2\u5220\u9664\u672c\u5730\u89c6\u9891\uff1a\", video_path)\n\n    # \u53ef\u4ee5\u52a0\u77ed\u6682\u5ef6\u8fdf\n    time.sleep(2)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c0f\u7ea2\u4e66<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>from selenium import webdriver\nfrom selenium.webdriver.edge.service import Service\nfrom selenium.webdriver.common.by import By\nfrom selenium.common.exceptions import NoSuchElementException\nfrom selenium.webdriver.edge.options import Options\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nimport time\nimport random\n\n\n# \u521b\u5efa Edge Options \u5bf9\u8c61\noptions = Options()\n\n# \u8bbe\u7f6e\u6d4f\u89c8\u5668\u542f\u52a8\u53c2\u6570\uff0c\u5173\u95ed\u4e0d\u5fc5\u8981\u7684\u65e5\u5fd7\noptions.add_argument('--disable-logging')  # \u7981\u7528\u6240\u6709\u65e5\u5fd7\noptions.add_argument('--log-level=3')      # \u4ec5\u663e\u793a\u9519\u8bef\u65e5\u5fd7\noptions.add_argument('--ignore-certificate-errors')  # \u5ffd\u7565SSL\u8bc1\u4e66\u9519\u8bef\noptions.add_argument('--ignore-ssl-errors=yes')      # \u5ffd\u7565SSL\u9519\u8bef\n\n#\u5b9a\u4e49\u6d4f\u89c8\u5668\u9a71\u52a8\nwd = webdriver.Edge()\n\n#\u6253\u5f00\u7f51\u9875\nwd.get('https:\/\/creator.xiaohongshu.com\/login')\n\nprint(\"\u8bf7\u626b\u7801\u767b\u5f55\u6296\u97f3\u521b\u4f5c\u8005\u4e2d\u5fc3...\")\n\n# \u7b49\u5f85\u767b\u5f55\u5b8c\u6210\uff08\u51fa\u73b0\u53d1\u5e03\u6309\u94ae\uff09\nWebDriverWait(wd, 300).until(\n    EC.presence_of_element_located(\n        (By.XPATH, \"\/html\/body\/div&#91;1]\/div\/div&#91;2]\/div\/div&#91;2]\/main\/div&#91;1]\/div\/div&#91;1]\/div\")  # \u53d1\u5e03\u6309\u94ae\n    )\n)\n\nprint(\"\u767b\u5f55\u6210\u529f\")\n\neelement = wd.find_element(By.XPATH,\n                          \"\/html\/body\/div&#91;7]\/div&#91;1]\/button\")\neelement.click()\n\n\nimport os\nimport time\n\nVIDEO_DIR = \"\/Users\/yuanningmuyou\/PycharmProjects\/\u81ea\u52a8\u5316\/shipin\/\"\nVIDEO_EXTS = (\".mp4\", \".mov\", \".avi\", \".mkv\")\n\nwhile True:\n    # \u83b7\u53d6\u6587\u4ef6\u5939\u4e2d\u6240\u6709\u89c6\u9891\n    videos = &#91;f for f in os.listdir(VIDEO_DIR) if f.lower().endswith(VIDEO_EXTS)]\n\n    # \u6587\u4ef6\u5939\u7a7a\u4e86\u5c31\u9000\u51fa\n    if not videos:\n        print(\"\u89c6\u9891\u5df2\u5168\u90e8\u5904\u7406\u5b8c\u6210\uff01\")\n        break\n\n    # \u53d6\u7b2c\u4e00\u4e2a\u89c6\u9891\n    video_file = videos&#91;0]\n    video_path = os.path.join(VIDEO_DIR, video_file)\n    print(\"\u51c6\u5907\u5904\u7406\u89c6\u9891\uff1a\", video_path)\n\n    # \u53d1\u5e03\u9875\u9762\n    wd.get('https:\/\/creator.xiaohongshu.com\/publish\/publish?from=menu&amp;target=video')\n\n    # \u4e0a\u4f20\u6587\u4ef6\n    input_element = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH, \"\/\/input&#91;@type='file']\")\n        )\n    )\n    import os\n\n    VIDEO_DIR = \"\/Users\/yuanningmuyou\/PycharmProjects\/\u81ea\u52a8\u5316\/shipin\/\"\n    VIDEO_EXTS = (\".mp4\", \".mov\", \".avi\", \".mkv\")\n\n    videos = &#91;\n        os.path.join(VIDEO_DIR, f)\n        for f in os.listdir(VIDEO_DIR)\n        if f.lower().endswith(VIDEO_EXTS)\n    ]\n\n    if not videos:\n        raise Exception(\"\u89c6\u9891\u6587\u4ef6\u5939\u4e2d\u6ca1\u6709\u53ef\u4e0a\u4f20\u7684\u89c6\u9891\")\n\n    video_path = random.choice(videos)\n    print(\"\u51c6\u5907\u4e0a\u4f20\u89c6\u9891\uff1a\", video_path)\n\n    # \u4e0a\u4f20\u89c6\u9891\n    input_element.send_keys(video_path)\n    print(\"\u89c6\u9891\u5df2\u9009\u62e9\uff0c\u5f00\u59cb\u4e0a\u4f20...\")\n\n    desc_div = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH, \"\/\/*&#91;@id='publish-container']\/div&#91;2]\/div&#91;1]\/div&#91;1]\/div&#91;5]\/div\/div\/div&#91;1]\/div&#91;1]\/div\/div\")\n        )\n    )\n\n    success_msg = WebDriverWait(wd, 300).until(\n        EC.presence_of_element_located(\n            (By.XPATH,\n             \"\/\/*&#91;@id='publish-container']\/div&#91;2]\/div&#91;1]\/div&#91;1]\/div&#91;2]\/div&#91;1]\/div\/div&#91;1]\/div&#91;2]\/div\/div&#91;1]\")\n        )\n    )\n\n    print(\"\u89c6\u9891\u4e0a\u4f20\u6210\u529f\uff01\")\n\n    desc_div.click()\n    desc_div.send_keys(\"\u5929\u7136\u690d\u7269\uff0c\u6ca1\u6709\u9ed1\u79d1\u6280\uff0c\u65e0\u6dfb\u52a0\")\n\n    # \u53d1\u5e03\n\n    click_btn = WebDriverWait(wd, 30).until(\n        EC.element_to_be_clickable(\n            (By.XPATH,\n             \"\/html\/body\/div&#91;1]\/div\/div&#91;2]\/div\/div&#91;2]\/main\/div&#91;3]\/div\/div\/div\/div\/div\/div\/div&#91;2]\/div&#91;2]\/div\/button&#91;1]\")\n        )\n    )\n\n    click_btn.click()\n\n    os.remove(video_path)\n    print(\"\u5df2\u5220\u9664\u672c\u5730\u89c6\u9891\uff1a\", video_path)\n\n    # \u53ef\u4ee5\u52a0\u77ed\u6682\u5ef6\u8fdf\n    time.sleep(2)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b64\u7a0b\u5e8f\u4e3aPython\u5236\u4f5c \u4f7f\u7528selenium\u6a21\u62df\u7528\u6237\u70b9\u51fb\u7f51\u9875 \u672c\u4eba\u8fd0\u884c\u73af\u5883\u4e3am\u7cfb\u5217mac\u672a\u5c1d\u8bd5\u79fb\u690dwindo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/comments?post=182"}],"version-history":[{"count":2,"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":185,"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/posts\/182\/revisions\/185"}],"wp:attachment":[{"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/media?parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/categories?post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.muyou.wiki\/index.php\/wp-json\/wp\/v2\/tags?post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}