{"id":1125493,"date":"2025-01-08T19:52:19","date_gmt":"2025-01-08T11:52:19","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1125493.html"},"modified":"2025-01-08T19:52:21","modified_gmt":"2025-01-08T11:52:21","slug":"python%e7%88%ac%e8%99%ab%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%e7%99%bb%e5%bd%95%e9%aa%8c%e8%af%81%e7%a0%81%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1125493.html","title":{"rendered":"python\u722c\u866b\u5982\u4f55\u89e3\u51b3\u767b\u5f55\u9a8c\u8bc1\u7801\u95ee\u9898"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25090146\/485c1d1d-4de9-466c-b625-4cca66dd9128.webp\" alt=\"python\u722c\u866b\u5982\u4f55\u89e3\u51b3\u767b\u5f55\u9a8c\u8bc1\u7801\u95ee\u9898\" \/><\/p>\n<p><p> <strong>Python\u722c\u866b\u5982\u4f55\u89e3\u51b3\u767b\u5f55\u9a8c\u8bc1\u7801\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u8fdb\u884cWeb\u722c\u866b\u65f6\uff0c\u767b\u5f55\u9a8c\u8bc1\u7801\u901a\u5e38\u662f\u4e00\u4e2a\u4e3b\u8981\u7684\u969c\u788d\uff0c\u4f46\u901a\u8fc7<strong>OCR\u6280\u672f\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u6253\u7801\u5e73\u53f0\u3001\u6a21\u62df\u7528\u6237\u884c\u4e3a<\/strong>\u7b49\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u6709\u6548\u5730\u5e94\u5bf9\u8fd9\u4e00\u6311\u6218\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u53ca\u5176\u5b9e\u73b0\u6b65\u9aa4\uff0c\u5e76\u5206\u4eab\u4e2a\u4eba\u7ecf\u9a8c\u3002<\/p>\n<\/p>\n<p><p>\u5176\u4e2d\uff0c<strong>OCR\u6280\u672f<\/strong>\u53ef\u4ee5\u901a\u8fc7\u56fe\u50cf\u8bc6\u522b\u6280\u672f\u81ea\u52a8\u63d0\u53d6\u9a8c\u8bc1\u7801\u4e2d\u7684\u5b57\u7b26\uff0c\u51cf\u5c11\u4eba\u5de5\u5e72\u9884\uff0c\u63d0\u9ad8\u722c\u866b\u7684\u6548\u7387\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u5229\u7528OCR\u6280\u672f\u89e3\u51b3\u9a8c\u8bc1\u7801\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001OCR\u6280\u672f<\/h3>\n<\/p>\n<p><p>OCR\uff08Optical Character Recognition\uff0c\u5149\u5b66\u5b57\u7b26\u8bc6\u522b\uff09\u662f\u901a\u8fc7\u56fe\u50cf\u5904\u7406\u6280\u672f\u5c06\u56fe\u7247\u4e2d\u7684\u6587\u5b57\u8f6c\u6362\u4e3a\u6587\u672c\u7684\u6280\u672f\u3002\u5728\u89e3\u51b3\u9a8c\u8bc1\u7801\u95ee\u9898\u65f6\uff0cOCR\u6280\u672f\u53ef\u4ee5\u975e\u5e38\u6709\u6548\u5730\u8bc6\u522b\u7b80\u5355\u7684\u5b57\u7b26\u9a8c\u8bc1\u7801\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528Tesseract\u5e93<\/h4>\n<\/p>\n<p><p>Tesseract\u662f\u4e00\u4e2a\u5f00\u6e90\u7684OCR\u5f15\u64ce\uff0c\u53ef\u4ee5\u8bc6\u522b\u591a\u79cd\u8bed\u8a00\u7684\u6587\u672c\u3002Python\u4e2d\u53ef\u4ee5\u901a\u8fc7 <code>pytesseract<\/code> \u5e93\u6765\u8c03\u7528 Tesseract \u5b9e\u73b0 OCR \u8bc6\u522b\u3002<\/p>\n<\/p>\n<p><h5>\u5b89\u88c5Tesseract<\/h5>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5728\u7cfb\u7edf\u4e2d\u5b89\u88c5Tesseract\u5f15\u64ce\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">sudo apt-get install tesseract-ocr<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h5>\u5b89\u88c5pytesseract\u5e93<\/h5>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u901a\u8fc7pip\u5b89\u88c5pytesseract\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install pytesseract<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h5>\u4f7f\u7528Tesseract\u8bc6\u522b\u9a8c\u8bc1\u7801<\/h5>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u6f14\u793a\u5982\u4f55\u4f7f\u7528Tesseract\u8bc6\u522b\u9a8c\u8bc1\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pytesseract<\/p>\n<p>from PIL import Image<\/p>\n<h2><strong>\u6253\u5f00\u9a8c\u8bc1\u7801\u56fe\u7247<\/strong><\/h2>\n<p>image = Image.open(&#39;captcha.png&#39;)<\/p>\n<h2><strong>\u4f7f\u7528pytesseract\u8fdb\u884cOCR\u8bc6\u522b<\/strong><\/h2>\n<p>captcha_text = pytesseract.image_to_string(image)<\/p>\n<p>print(f&quot;\u8bc6\u522b\u7684\u9a8c\u8bc1\u7801\u662f: {captcha_text}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u56fe\u50cf\u9884\u5904\u7406<\/h4>\n<\/p>\n<p><p>\u9a8c\u8bc1\u7801\u56fe\u7247\u901a\u5e38\u4f1a\u5305\u542b\u4e00\u4e9b\u566a\u58f0\u548c\u5e72\u6270\uff0c\u4e3a\u4e86\u63d0\u9ad8OCR\u7684\u8bc6\u522b\u7387\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u56fe\u7247\u8fdb\u884c\u9884\u5904\u7406\u3002\u5e38\u89c1\u7684\u9884\u5904\u7406\u6280\u672f\u5305\u62ec\u4e8c\u503c\u5316\u3001\u53bb\u566a\u3001\u8fb9\u7f18\u68c0\u6d4b\u7b49\u3002<\/p>\n<\/p>\n<p><h5>\u56fe\u50cf\u4e8c\u503c\u5316<\/h5>\n<\/p>\n<p><p>\u4e8c\u503c\u5316\u662f\u5c06\u56fe\u50cf\u8f6c\u6362\u4e3a\u9ed1\u767d\u56fe\u7247\uff0c\u4ee5\u4fbf\u4e8eOCR\u7684\u8bc6\u522b\u3002\u53ef\u4ee5\u4f7f\u7528OpenCV\u5e93\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cv2<\/p>\n<h2><strong>\u8bfb\u53d6\u56fe\u7247<\/strong><\/h2>\n<p>image = cv2.imread(&#39;captcha.png&#39;, 0)<\/p>\n<h2><strong>\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406<\/strong><\/h2>\n<p>_, binary_image = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY)<\/p>\n<h2><strong>\u4fdd\u5b58\u5904\u7406\u540e\u7684\u56fe\u7247<\/strong><\/h2>\n<p>cv2.imwrite(&#39;binary_captcha.png&#39;, binary_image)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h5>\u53bb\u566a\u5904\u7406<\/h5>\n<\/p>\n<p><p>\u53bb\u566a\u5904\u7406\u53ef\u4ee5\u53bb\u9664\u9a8c\u8bc1\u7801\u56fe\u7247\u4e2d\u7684\u566a\u58f0\uff0c\u63d0\u9ad8\u8bc6\u522b\u7387\u3002\u5e38\u89c1\u7684\u53bb\u566a\u65b9\u6cd5\u5305\u62ec\u4e2d\u503c\u6ee4\u6ce2\u3001\u5747\u503c\u6ee4\u6ce2\u7b49\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u4e2d\u503c\u6ee4\u6ce2\u53bb\u566a<\/p>\n<p>denoised_image = cv2.medianBlur(binary_image, 3)<\/p>\n<h2><strong>\u4fdd\u5b58\u5904\u7406\u540e\u7684\u56fe\u7247<\/strong><\/h2>\n<p>cv2.imwrite(&#39;denoised_captcha.png&#39;, denoised_image)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u6253\u7801\u5e73\u53f0<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u590d\u6742\u7684\u9a8c\u8bc1\u7801\uff0cOCR\u6280\u672f\u53ef\u80fd\u65e0\u6cd5\u51c6\u786e\u8bc6\u522b\uff0c\u8fd9\u65f6\u53ef\u4ee5\u501f\u52a9\u7b2c\u4e09\u65b9\u6253\u7801\u5e73\u53f0\u3002\u8fd9\u4e9b\u5e73\u53f0\u63d0\u4f9b\u4e86API\u63a5\u53e3\uff0c\u53ef\u4ee5\u5c06\u9a8c\u8bc1\u7801\u56fe\u7247\u4e0a\u4f20\u5230\u5e73\u53f0\uff0c\u7531\u4eba\u5de5\u6216\u667a\u80fd\u7cfb\u7edf\u8fdb\u884c\u8bc6\u522b\uff0c\u8fd4\u56de\u8bc6\u522b\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u9009\u62e9\u6253\u7801\u5e73\u53f0<\/h4>\n<\/p>\n<p><p>\u5e38\u89c1\u7684\u6253\u7801\u5e73\u53f0\u5305\u62ec\u8d85\u7ea7\u9e70\u3001\u4e91\u6253\u7801\u7b49\u3002\u9009\u62e9\u4e00\u4e2a\u53ef\u9760\u7684\u5e73\u53f0\uff0c\u53ef\u4ee5\u63d0\u9ad8\u9a8c\u8bc1\u7801\u8bc6\u522b\u7684\u6210\u529f\u7387\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u6ce8\u518c\u5e76\u83b7\u53d6API Key<\/h4>\n<\/p>\n<p><p>\u5728\u6253\u7801\u5e73\u53f0\u4e0a\u6ce8\u518c\u8d26\u6237\uff0c\u5e76\u83b7\u53d6API Key\uff0c\u7528\u4e8e\u8c03\u7528\u5e73\u53f0\u7684API\u63a5\u53e3\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u8c03\u7528\u6253\u7801\u5e73\u53f0API<\/h4>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u8c03\u7528\u8d85\u7ea7\u9e70\u6253\u7801\u5e73\u53f0API\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<h2><strong>\u8d85\u7ea7\u9e70API Key<\/strong><\/h2>\n<p>api_key = &#39;your_api_key&#39;<\/p>\n<h2><strong>\u4e0a\u4f20\u9a8c\u8bc1\u7801\u56fe\u7247<\/strong><\/h2>\n<p>with open(&#39;captcha.png&#39;, &#39;rb&#39;) as f:<\/p>\n<p>    files = {&#39;file&#39;: f}<\/p>\n<p>    response = requests.post(f&#39;http:\/\/upload.chaojiying.net\/Upload\/Processing.php?user=your_username&amp;pass2=your_password&amp;softid=your_softid&#39;, files=files)<\/p>\n<h2><strong>\u89e3\u6790\u8fd4\u56de\u7ed3\u679c<\/strong><\/h2>\n<p>result = response.json()<\/p>\n<p>captcha_text = result[&#39;pic_str&#39;]<\/p>\n<p>print(f&quot;\u8bc6\u522b\u7684\u9a8c\u8bc1\u7801\u662f: {captcha_text}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u6a21\u62df\u7528\u6237\u884c\u4e3a<\/h3>\n<\/p>\n<p><p>\u4e00\u4e9b\u7f51\u7ad9\u53ef\u80fd\u4f7f\u7528\u66f4\u590d\u6742\u7684\u9a8c\u8bc1\u7801\u6216\u8005\u52a8\u6001\u9a8c\u8bc1\u7801\uff0c\u8fd9\u65f6\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6a21\u62df\u7528\u6237\u884c\u4e3a\u6765\u7ed5\u8fc7\u9a8c\u8bc1\u7801\u3002\u4f8b\u5982\uff0c\u5229\u7528Selenium\u5e93\u6a21\u62df\u7528\u6237\u624b\u52a8\u8f93\u5165\u9a8c\u8bc1\u7801\uff0c\u6216\u901a\u8fc7\u5206\u6790\u7f51\u7ad9\u7684\u9a8c\u8bc1\u7801\u751f\u6210\u673a\u5236\uff0c\u751f\u6210\u5bf9\u5e94\u7684\u9a8c\u8bc1\u7801\u7b54\u6848\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528Selenium\u6a21\u62df\u7528\u6237\u884c\u4e3a<\/h4>\n<\/p>\n<p><p>Selenium\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6d4f\u89c8\u5668\u81ea\u52a8\u5316\u5de5\u5177\uff0c\u53ef\u4ee5\u6a21\u62df\u7528\u6237\u7684\u5404\u79cd\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528Selenium\u624b\u52a8\u8f93\u5165\u9a8c\u8bc1\u7801\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from selenium import webdriver<\/p>\n<p>import time<\/p>\n<h2><strong>\u542f\u52a8\u6d4f\u89c8\u5668<\/strong><\/h2>\n<p>driver = webdriver.Chrome()<\/p>\n<h2><strong>\u6253\u5f00\u767b\u5f55\u9875\u9762<\/strong><\/h2>\n<p>driver.get(&#39;http:\/\/example.com\/login&#39;)<\/p>\n<h2><strong>\u8bc6\u522b\u9a8c\u8bc1\u7801<\/strong><\/h2>\n<p>captcha_image = driver.find_element_by_id(&#39;captcha_image&#39;)<\/p>\n<p>captcha_text = input(&quot;\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801: &quot;)<\/p>\n<h2><strong>\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u9a8c\u8bc1\u7801<\/strong><\/h2>\n<p>driver.find_element_by_id(&#39;username&#39;).send_keys(&#39;your_username&#39;)<\/p>\n<p>driver.find_element_by_id(&#39;password&#39;).send_keys(&#39;your_password&#39;)<\/p>\n<p>driver.find_element_by_id(&#39;captcha&#39;).send_keys(captcha_text)<\/p>\n<h2><strong>\u63d0\u4ea4\u8868\u5355<\/strong><\/h2>\n<p>driver.find_element_by_id(&#39;login_button&#39;).click()<\/p>\n<h2><strong>\u7b49\u5f85\u9875\u9762\u52a0\u8f7d<\/strong><\/h2>\n<p>time.sleep(3)<\/p>\n<h2><strong>\u68c0\u67e5\u767b\u5f55\u662f\u5426\u6210\u529f<\/strong><\/h2>\n<p>if &quot;\u767b\u5f55\u6210\u529f&quot; in driver.page_source:<\/p>\n<p>    print(&quot;\u767b\u5f55\u6210\u529f&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;\u767b\u5f55\u5931\u8d25&quot;)<\/p>\n<h2><strong>\u5173\u95ed\u6d4f\u89c8\u5668<\/strong><\/h2>\n<p>driver.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u5206\u6790\u9a8c\u8bc1\u7801\u751f\u6210\u673a\u5236<\/h4>\n<\/p>\n<p><p>\u6709\u4e9b\u7f51\u7ad9\u7684\u9a8c\u8bc1\u7801\u751f\u6210\u673a\u5236\u53ef\u80fd\u5b58\u5728\u6f0f\u6d1e\uff0c\u901a\u8fc7\u5206\u6790\u5176\u751f\u6210\u7b97\u6cd5\uff0c\u53ef\u4ee5\u76f4\u63a5\u751f\u6210\u6b63\u786e\u7684\u9a8c\u8bc1\u7801\u7b54\u6848\u3002\u4f8b\u5982\uff0c\u5982\u679c\u9a8c\u8bc1\u7801\u662f\u57fa\u4e8e\u65f6\u95f4\u6233\u751f\u6210\u7684\uff0c\u53ef\u4ee5\u901a\u8fc7\u6a21\u62df\u76f8\u540c\u7684\u65f6\u95f4\u6233\u751f\u6210\u76f8\u540c\u7684\u9a8c\u8bc1\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u603b\u7ed3\u4e0e\u5efa\u8bae<\/h3>\n<\/p>\n<p><p>\u89e3\u51b3\u767b\u5f55\u9a8c\u8bc1\u7801\u95ee\u9898\u662fWeb\u722c\u866b\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u6311\u6218\uff0c\u4f46\u901a\u8fc7<strong>OCR\u6280\u672f\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u6253\u7801\u5e73\u53f0\u3001\u6a21\u62df\u7528\u6237\u884c\u4e3a<\/strong>\u7b49\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u6709\u6548\u5730\u5e94\u5bf9\u8fd9\u4e00\u6311\u6218\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u60c5\u51b5\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\uff0c\u7ed3\u5408\u591a\u79cd\u6280\u672f\u624b\u6bb5\uff0c\u63d0\u9ad8\u9a8c\u8bc1\u7801\u8bc6\u522b\u7684\u6210\u529f\u7387\u3002<\/p>\n<\/p>\n<p><p>\u6b64\u5916\uff0c\u5efa\u8bae\u5728\u8fdb\u884cWeb\u722c\u866b\u65f6\uff0c\u9075\u5b88\u7f51\u7ad9\u7684\u4f7f\u7528\u534f\u8bae\uff0c\u907f\u514d\u8fc7\u5ea6\u6293\u53d6\u5bf9\u7f51\u7ad9\u9020\u6210\u8d1f\u62c5\u3002\u5408\u7406\u8bbe\u7f6e\u722c\u866b\u7684\u6293\u53d6\u9891\u7387\uff0c\u907f\u514d\u89e6\u53d1\u7f51\u7ad9\u7684\u53cd\u722c\u673a\u5236\u3002\u901a\u8fc7\u5408\u6cd5\u3001\u5408\u7406\u7684\u65b9\u5f0f\u8fdb\u884c\u6570\u636e\u6293\u53d6\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u63d0\u9ad8\u722c\u866b\u7684\u6548\u7387\u548c\u7a33\u5b9a\u6027\uff0c\u4e5f\u6709\u52a9\u4e8e\u7ef4\u62a4\u826f\u597d\u7684\u4e92\u8054\u7f51\u73af\u5883\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u722c\u866b\u4e2d\u8bc6\u522b\u548c\u5904\u7406\u9a8c\u8bc1\u7801\uff1f<\/strong><br \/>\u5904\u7406\u9a8c\u8bc1\u7801\u7684\u5173\u952e\u5728\u4e8e\u4f7f\u7528\u56fe\u50cf\u8bc6\u522b\u6280\u672f\u3002\u5e38\u89c1\u7684\u5e93\u5982Tesseract OCR\u53ef\u4ee5\u5e2e\u52a9\u8bc6\u522b\u56fe\u50cf\u4e2d\u7684\u5b57\u7b26\u3002\u6b64\u5916\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u6765\u8bad\u7ec3\u7279\u5b9a\u7c7b\u578b\u7684\u9a8c\u8bc1\u7801\u8bc6\u522b\u5668\u3002\u901a\u8fc7\u8fd9\u6837\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5c06\u9a8c\u8bc1\u7801\u8f6c\u5316\u4e3a\u53ef\u8bfb\u6587\u672c\uff0c\u4ece\u800c\u5b8c\u6210\u81ea\u52a8\u767b\u5f55\u3002<\/p>\n<p><strong>\u6709\u6ca1\u6709\u73b0\u6210\u7684\u5e93\u53ef\u4ee5\u5e2e\u52a9\u89e3\u51b3\u9a8c\u8bc1\u7801\u95ee\u9898\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u9488\u5bf9\u4e0d\u540c\u7c7b\u578b\u7684\u9a8c\u8bc1\u7801\uff0c\u6709\u4e00\u4e9b\u5f00\u6e90\u5e93\u548c\u5de5\u5177\u53ef\u4ee5\u4f7f\u7528\u3002\u4f8b\u5982\uff0c<code>captcha<\/code>\u5e93\u53ef\u4ee5\u751f\u6210\u548c\u9a8c\u8bc1\u7b80\u5355\u7684\u9a8c\u8bc1\u7801\uff0c\u800c<code>easyocr<\/code>\u548c<code>pytesseract<\/code>\u5219\u53ef\u4ee5\u7528\u4e8e\u66f4\u590d\u6742\u7684\u56fe\u50cf\u8bc6\u522b\u3002\u8fd8\u6709\u4e00\u4e9b\u670d\u52a1\u59822Captcha\u548cAnti-Captcha\uff0c\u63d0\u4f9b\u4e86API\u53ef\u4ee5\u81ea\u52a8\u89e3\u51b3\u9a8c\u8bc1\u7801\u3002<\/p>\n<p><strong>\u5982\u4f55\u907f\u514d\u5728\u722c\u866b\u4e2d\u9891\u7e41\u9047\u5230\u9a8c\u8bc1\u7801\uff1f<\/strong><br \/>\u4e3a\u4e86\u51cf\u5c11\u88ab\u7f51\u7ad9\u68c0\u6d4b\u5230\u5e76\u89e6\u53d1\u9a8c\u8bc1\u7801\u7684\u6982\u7387\uff0c\u53ef\u4ee5\u901a\u8fc7\u6a21\u62df\u7528\u6237\u884c\u4e3a\u6765\u5b9e\u73b0\u3002\u4f8b\u5982\uff0c\u8bbe\u7f6e\u5408\u7406\u7684\u8bf7\u6c42\u95f4\u9694\u3001\u4f7f\u7528\u4ee3\u7406IP\u3001\u968f\u673a\u5316\u8bf7\u6c42\u5934\u4fe1\u606f\u7b49\uff0c\u90fd\u662f\u6709\u6548\u7684\u65b9\u6cd5\u3002\u6b64\u5916\uff0c\u964d\u4f4e\u722c\u866b\u7684\u8bf7\u6c42\u9891\u7387\u548c\u6570\u91cf\uff0c\u4ee5\u53ca\u5728\u7279\u5b9a\u65f6\u6bb5\u8fdb\u884c\u722c\u53d6\uff0c\u4e5f\u80fd\u51cf\u5c11\u9a8c\u8bc1\u7801\u7684\u51fa\u73b0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u722c\u866b\u5982\u4f55\u89e3\u51b3\u767b\u5f55\u9a8c\u8bc1\u7801\u95ee\u9898 \u5728\u8fdb\u884cWeb\u722c\u866b\u65f6\uff0c\u767b\u5f55\u9a8c\u8bc1\u7801\u901a\u5e38\u662f\u4e00\u4e2a\u4e3b\u8981\u7684\u969c\u788d\uff0c\u4f46\u901a\u8fc7OCR\u6280\u672f\u3001 [&hellip;]","protected":false},"author":3,"featured_media":1125498,"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\/1125493"}],"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=1125493"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1125493\/revisions"}],"predecessor-version":[{"id":1125501,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1125493\/revisions\/1125501"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1125498"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1125493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1125493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1125493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}