{"id":1069717,"date":"2025-01-08T10:51:33","date_gmt":"2025-01-08T02:51:33","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1069717.html"},"modified":"2025-01-08T10:51:36","modified_gmt":"2025-01-08T02:51:36","slug":"python%e5%a6%82%e4%bd%95%e6%a8%a1%e6%8b%9fqq%e5%ae%a2%e6%88%b7%e7%ab%af%e7%99%bb%e5%bd%95-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1069717.html","title":{"rendered":"Python\u5982\u4f55\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25100648\/75229051-e7a0-47c4-83d6-58e4b20de87d.webp\" alt=\"Python\u5982\u4f55\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\" \/><\/p>\n<p><p> <strong>Python\u5982\u4f55\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u5b9e\u73b0\uff1a<strong>\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u5982<code>requests<\/code>\u8fdb\u884cHTTP\u8bf7\u6c42\u3001\u4f7f\u7528Selenium\u6a21\u62df\u6d4f\u89c8\u5668\u64cd\u4f5c\u3001\u901a\u8fc7\u9006\u5411\u5de5\u7a0b\u5206\u6790QQ\u534f\u8bae<\/strong>\u3002\u5728\u8fd9\u4e4b\u4e2d\uff0c\u4f7f\u7528<code>requests<\/code>\u8fdb\u884cHTTP\u8bf7\u6c42\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528<code>requests<\/code>\u5e93\u8fdb\u884c\u6a21\u62df\u767b\u5f55\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528requests\u5e93\u8fdb\u884cHTTP\u8bf7\u6c42<\/strong><\/p>\n<\/p>\n<p><p><code>requests<\/code>\u5e93\u662fPython\u4e2d\u6700\u5e38\u7528\u7684HTTP\u5e93\u4e4b\u4e00\uff0c\u80fd\u591f\u65b9\u4fbf\u5730\u8fdb\u884cHTTP\u8bf7\u6c42\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528<code>requests<\/code>\u5e93\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u83b7\u53d6\u767b\u5f55\u9875\u9762\u548c\u5fc5\u8981\u53c2\u6570<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u83b7\u53d6QQ\u767b\u5f55\u9875\u9762\uff0c\u5e76\u63d0\u53d6\u767b\u5f55\u6240\u9700\u7684\u53c2\u6570\u3002\u901a\u5e38\uff0cQQ\u767b\u5f55\u9875\u9762\u4f1a\u5305\u542b\u4e00\u4e9b\u9690\u85cf\u5b57\u6bb5\u548c\u52a8\u6001\u751f\u6210\u7684\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u5728\u767b\u5f55\u65f6\u662f\u5fc5\u9700\u7684\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>from bs4 import BeautifulSoup<\/p>\n<p>login_url = &#39;https:\/\/ui.ptlogin2.qq.com\/cgi-bin\/login&#39;<\/p>\n<p>session = requests.Session()<\/p>\n<p>response = session.get(login_url)<\/p>\n<p>soup = BeautifulSoup(response.text, &#39;html.parser&#39;)<\/p>\n<h2><strong>\u63d0\u53d6\u5fc5\u8981\u7684\u53c2\u6570\uff0c\u4f8b\u5982pt_login_sig<\/strong><\/h2>\n<p>pt_login_sig = soup.find(&#39;input&#39;, {&#39;name&#39;: &#39;pt_login_sig&#39;})[&#39;value&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u6a21\u62df\u767b\u5f55\u8bf7\u6c42<\/h3>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u6784\u9020\u767b\u5f55\u8bf7\u6c42\uff0c\u5e76\u53d1\u9001\u6a21\u62df\u7684\u767b\u5f55\u8bf7\u6c42\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cQQ\u7684\u767b\u5f55\u8bf7\u6c42\u901a\u5e38\u4f1a\u5305\u542b\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u9a8c\u8bc1\u7801\u7b49\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">login_data = {<\/p>\n<p>    &#39;u&#39;: &#39;your_qq_number&#39;,<\/p>\n<p>    &#39;p&#39;: &#39;your_password&#39;,<\/p>\n<p>    &#39;verifycode&#39;: &#39;captcha_code&#39;,  # \u5982\u679c\u9700\u8981\u9a8c\u8bc1\u7801\uff0c\u53ef\u4ee5\u901a\u8fc7\u9a8c\u8bc1\u7801\u8bc6\u522b\u670d\u52a1\u83b7\u53d6<\/p>\n<p>    &#39;pt_login_sig&#39;: pt_login_sig,<\/p>\n<p>    &#39;u1&#39;: &#39;https:\/\/m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>l.qq.com\/cgi-bin\/login&#39;,<\/p>\n<p>    &#39;ptredirect&#39;: 0,<\/p>\n<p>    &#39;h&#39;: 1,<\/p>\n<p>    &#39;t&#39;: 1,<\/p>\n<p>    &#39;g&#39;: 1,<\/p>\n<p>    &#39;from_ui&#39;: 1,<\/p>\n<p>    &#39;ptlang&#39;: 2052,<\/p>\n<p>    &#39;action&#39;: &#39;3-22-1640834947250&#39;,<\/p>\n<p>    &#39;js_ver&#39;: 21031910,<\/p>\n<p>    &#39;js_type&#39;: 1,<\/p>\n<p>    &#39;login_sig&#39;: &#39;&#39;,<\/p>\n<p>    &#39;pt_uistyle&#39;: 40,<\/p>\n<p>    &#39;aid&#39;: 522005705,<\/p>\n<p>    &#39;daid&#39;: 4,<\/p>\n<p>    &#39;has_onekey&#39;: 1<\/p>\n<p>}<\/p>\n<p>login_response = session.post(login_url, data=login_data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5904\u7406\u767b\u5f55\u540e\u7684\u54cd\u5e94<\/h3>\n<\/p>\n<p><p>\u767b\u5f55\u540e\u7684\u54cd\u5e94\u4f1a\u5305\u542b\u4e00\u4e9bCookie\u548c\u8df3\u8f6c\u94fe\u63a5\uff0c\u901a\u8fc7\u8fd9\u4e9b\u4fe1\u606f\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u4e00\u6b65\u8bbf\u95ee\u9700\u8981\u767b\u5f55\u7684\u9875\u9762\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5904\u7406\u767b\u5f55\u54cd\u5e94\uff0c\u83b7\u53d6\u8df3\u8f6c\u94fe\u63a5<\/p>\n<p>redirect_url = login_response.text.split(&quot;&#39;&quot;)[1]<\/p>\n<h2><strong>\u8bbf\u95ee\u8df3\u8f6c\u94fe\u63a5\uff0c\u5b8c\u6210\u767b\u5f55<\/strong><\/h2>\n<p>final_response = session.get(redirect_url)<\/p>\n<h2><strong>\u6253\u5370\u6700\u7ec8\u54cd\u5e94\u7684\u5185\u5bb9\uff0c\u9a8c\u8bc1\u662f\u5426\u767b\u5f55\u6210\u529f<\/strong><\/h2>\n<p>print(final_response.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406\u9a8c\u8bc1\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0cQQ\u767b\u5f55\u901a\u5e38\u4f1a\u5305\u542b\u9a8c\u8bc1\u7801\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u5904\u7406\u9a8c\u8bc1\u7801\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u624b\u52a8\u8f93\u5165\u9a8c\u8bc1\u7801<\/strong>\uff1a\u5728\u767b\u5f55\u8fc7\u7a0b\u4e2d\uff0c\u63d0\u793a\u7528\u6237\u8f93\u5165\u9a8c\u8bc1\u7801\u3002<\/li>\n<li><strong>\u81ea\u52a8\u8bc6\u522b\u9a8c\u8bc1\u7801<\/strong>\uff1a\u4f7f\u7528\u7b2c\u4e09\u65b9\u9a8c\u8bc1\u7801\u8bc6\u522b\u670d\u52a1\uff08\u5982<code>Tesseract<\/code>\u3001<code>\u767e\u5ea6OCR<\/code>\u7b49\uff09\u81ea\u52a8\u8bc6\u522b\u9a8c\u8bc1\u7801\u3002<\/li>\n<\/ol>\n<p><p>\u4ee5\u4e0b\u662f\u4f7f\u7528<code>Tesseract<\/code>\u8fdb\u884c\u9a8c\u8bc1\u7801\u8bc6\u522b\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from PIL import Image<\/p>\n<p>import pytesseract<\/p>\n<h2><strong>\u4e0b\u8f7d\u9a8c\u8bc1\u7801\u56fe\u7247<\/strong><\/h2>\n<p>captcha_url = &#39;https:\/\/ssl.captcha.qq.com\/getimage&#39;<\/p>\n<p>captcha_response = session.get(captcha_url, stream=True)<\/p>\n<h2><strong>\u4fdd\u5b58\u9a8c\u8bc1\u7801\u56fe\u7247<\/strong><\/h2>\n<p>with open(&#39;captcha.jpg&#39;, &#39;wb&#39;) as f:<\/p>\n<p>    f.write(captcha_response.content)<\/p>\n<h2><strong>\u4f7f\u7528Tesseract\u8bc6\u522b\u9a8c\u8bc1\u7801<\/strong><\/h2>\n<p>captcha_code = pytesseract.image_to_string(Image.open(&#39;captcha.jpg&#39;))<\/p>\n<h2><strong>\u5728\u767b\u5f55\u8bf7\u6c42\u4e2d\u52a0\u5165\u8bc6\u522b\u7684\u9a8c\u8bc1\u7801<\/strong><\/h2>\n<p>login_data[&#39;verifycode&#39;] = captcha_code<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>requests<\/code>\u5e93\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cQQ\u7684\u767b\u5f55\u8fc7\u7a0b\u53ef\u80fd\u4f1a\u5305\u542b\u591a\u79cd\u53cd\u722c\u866b\u673a\u5236\uff08\u5982\u9a8c\u8bc1\u7801\u3001IP\u9650\u5236\u7b49\uff09\uff0c\u6211\u4eec\u9700\u8981\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<\/p>\n<p><p>\u6b64\u5916\uff0c\u6a21\u62df\u767b\u5f55QQ\u53ef\u80fd\u6d89\u53ca\u5230\u6cd5\u5f8b\u548c\u9053\u5fb7\u95ee\u9898\uff0c\u8bf7\u786e\u4fdd\u5728\u5408\u6cd5\u5408\u89c4\u7684\u524d\u63d0\u4e0b\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528Selenium\u6a21\u62df\u6d4f\u89c8\u5668\u64cd\u4f5c<\/strong><\/p>\n<\/p>\n<p><p>\u9664\u4e86\u4f7f\u7528<code>requests<\/code>\u5e93\u8fdb\u884cHTTP\u8bf7\u6c42\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528Selenium\u6a21\u62df\u6d4f\u89c8\u5668\u64cd\u4f5c\u3002Selenium\u53ef\u4ee5\u9a71\u52a8\u6d4f\u89c8\u5668\u8fdb\u884c\u81ea\u52a8\u5316\u64cd\u4f5c\uff0c\u80fd\u591f\u66f4\u597d\u5730\u5904\u7406\u590d\u6742\u7684\u767b\u5f55\u8fc7\u7a0b\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5Selenium\u548c\u6d4f\u89c8\u5668\u9a71\u52a8<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5Selenium\u5e93\u548c\u5bf9\u5e94\u7684\u6d4f\u89c8\u5668\u9a71\u52a8\uff08\u5982ChromeDriver\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install selenium<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e0b\u8f7d\u5e76\u5b89\u88c5ChromeDriver\uff1a<a href=\"https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/downloads\">https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/downloads<\/a><\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u7f16\u5199Selenium\u811a\u672c<\/h3>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4f7f\u7528Selenium\u6a21\u62dfQQ\u767b\u5f55\u7684\u793a\u4f8b\u811a\u672c\uff1a<\/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<p>import time<\/p>\n<h2><strong>\u542f\u52a8Chrome\u6d4f\u89c8\u5668<\/strong><\/h2>\n<p>driver = webdriver.Chrome(executable_path=&#39;\/path\/to\/chromedriver&#39;)<\/p>\n<h2><strong>\u8bbf\u95eeQQ\u767b\u5f55\u9875\u9762<\/strong><\/h2>\n<p>driver.get(&#39;https:\/\/ui.ptlogin2.qq.com\/cgi-bin\/login&#39;)<\/p>\n<h2><strong>\u8f93\u5165QQ\u53f7\u548c\u5bc6\u7801<\/strong><\/h2>\n<p>qq_number = driver.find_element(By.ID, &#39;u&#39;)<\/p>\n<p>qq_number.send_keys(&#39;your_qq_number&#39;)<\/p>\n<p>password = driver.find_element(By.ID, &#39;p&#39;)<\/p>\n<p>password.send_keys(&#39;your_password&#39;)<\/p>\n<h2><strong>\u70b9\u51fb\u767b\u5f55\u6309\u94ae<\/strong><\/h2>\n<p>login_button = driver.find_element(By.ID, &#39;login_button&#39;)<\/p>\n<p>login_button.click()<\/p>\n<h2><strong>\u7b49\u5f85\u9875\u9762\u52a0\u8f7d\uff0c\u5904\u7406\u9a8c\u8bc1\u7801\uff08\u5982\u679c\u6709\uff09<\/strong><\/h2>\n<p>time.sleep(5)<\/p>\n<h2><strong>\u83b7\u53d6\u767b\u5f55\u540e\u7684\u9875\u9762\u5185\u5bb9<\/strong><\/h2>\n<p>page_content = driver.page_source<\/p>\n<p>print(page_content)<\/p>\n<h2><strong>\u5173\u95ed\u6d4f\u89c8\u5668<\/strong><\/h2>\n<p>driver.quit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u901a\u8fc7\u9006\u5411\u5de5\u7a0b\u5206\u6790QQ\u534f\u8bae<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u9006\u5411\u5de5\u7a0b\u5206\u6790QQ\u534f\u8bae\u4e5f\u662f\u4e00\u79cd\u6a21\u62df\u767b\u5f55\u7684\u65b9\u6cd5\u3002\u8fd9\u79cd\u65b9\u6cd5\u9700\u8981\u8f83\u9ad8\u7684\u6280\u672f\u6c34\u5e73\u548c\u7f51\u7edc\u534f\u8bae\u5206\u6790\u80fd\u529b\uff0c\u901a\u5e38\u901a\u8fc7\u6293\u5305\u5de5\u5177\uff08\u5982Wireshark\uff09\u5206\u6790QQ\u5ba2\u6237\u7aef\u7684\u7f51\u7edc\u901a\u4fe1\uff0c\u4e86\u89e3\u5176\u767b\u5f55\u534f\u8bae\uff0c\u7136\u540e\u4f7f\u7528Python\u7f16\u5199\u76f8\u5e94\u7684\u6a21\u62df\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u6293\u5305\u5206\u6790<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Wireshark\u7b49\u6293\u5305\u5de5\u5177\uff0c\u6355\u83b7QQ\u5ba2\u6237\u7aef\u7684\u767b\u5f55\u8bf7\u6c42\u548c\u54cd\u5e94\uff0c\u5206\u6790\u5176\u534f\u8bae\u7ec6\u8282\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u7f16\u5199\u6a21\u62df\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u6839\u636e\u6293\u5305\u5206\u6790\u7684\u7ed3\u679c\uff0c\u4f7f\u7528Python\u7f16\u5199\u6a21\u62df\u767b\u5f55\u7684\u4ee3\u7801\u3002\u53ef\u4ee5\u4f7f\u7528<code>socket<\/code>\u5e93\u76f4\u63a5\u8fdb\u884c\u7f51\u7edc\u901a\u4fe1\uff0c\u6a21\u62dfQQ\u534f\u8bae\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import socket<\/p>\n<h2><strong>\u521b\u5efasocket\u5bf9\u8c61<\/strong><\/h2>\n<p>client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<\/p>\n<h2><strong>\u8fde\u63a5QQ\u670d\u52a1\u5668<\/strong><\/h2>\n<p>client.connect((&#39;qq_server_ip&#39;, qq_server_port))<\/p>\n<h2><strong>\u6784\u9020\u767b\u5f55\u8bf7\u6c42\u6570\u636e<\/strong><\/h2>\n<p>login_request = b&#39;...&#39;<\/p>\n<h2><strong>\u53d1\u9001\u767b\u5f55\u8bf7\u6c42<\/strong><\/h2>\n<p>client.send(login_request)<\/p>\n<h2><strong>\u63a5\u6536\u767b\u5f55\u54cd\u5e94<\/strong><\/h2>\n<p>login_response = client.recv(1024)<\/p>\n<p>print(login_response)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>client.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u603b\u7ed3<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u7f3a\u70b9\uff0c\u9009\u62e9\u9002\u5408\u81ea\u5df1\u7684\u65b9\u6cd5\u8fdb\u884c\u5b9e\u73b0\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6a21\u62df\u767b\u5f55QQ\u53ef\u80fd\u6d89\u53ca\u5230\u6cd5\u5f8b\u548c\u9053\u5fb7\u95ee\u9898\uff0c\u8bf7\u786e\u4fdd\u5728\u5408\u6cd5\u5408\u89c4\u7684\u524d\u63d0\u4e0b\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u5b9e\u73b0QQ\u5ba2\u6237\u7aef\u7684\u81ea\u52a8\u767b\u5f55\u529f\u80fd\uff1f<\/strong><br \/>\u4e3a\u4e86\u5b9e\u73b0QQ\u5ba2\u6237\u7aef\u7684\u81ea\u52a8\u767b\u5f55\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u7684requests\u5e93\u548c\u4e00\u4e9b\u7f51\u7edc\u6293\u5305\u5de5\u5177\u6765\u5206\u6790QQ\u767b\u5f55\u7684\u8bf7\u6c42\u6d41\u7a0b\u3002\u901a\u8fc7\u6355\u83b7\u767b\u5f55\u65f6\u7684HTTP\u8bf7\u6c42\uff0c\u60a8\u53ef\u4ee5\u83b7\u53d6\u6240\u9700\u7684\u53c2\u6570\uff0c\u5e76\u5229\u7528Python\u4ee3\u7801\u6a21\u62df\u8fd9\u4e9b\u8bf7\u6c42\u3002\u8bf7\u786e\u4fdd\u9075\u5faaQQ\u7684\u4f7f\u7528\u6761\u6b3e\uff0c\u4ee5\u907f\u514d\u8fdd\u53cd\u76f8\u5173\u89c4\u5b9a\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u4f7f\u7528Python\u5e93\u6765\u5904\u7406QQ\u767b\u5f55\u7684\u9a8c\u8bc1\u7801\u95ee\u9898\uff1f<\/strong><br \/>\u9a8c\u8bc1\u7801\u662fQQ\u767b\u5f55\u4e2d\u7684\u4e00\u4e2a\u5e38\u89c1\u969c\u788d\uff0c\u4f7f\u7528Python\u53ef\u4ee5\u5c1d\u8bd5\u901a\u8fc7\u56fe\u50cf\u5904\u7406\u5e93\uff08\u5982Pillow\u548cOpenCV\uff09\u6765\u8bc6\u522b\u9a8c\u8bc1\u7801\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u65b9\u5f0f\u5e76\u4e0d\u603b\u662f\u6709\u6548\uff0c\u56e0\u4e3a\u9a8c\u8bc1\u7801\u8bbe\u8ba1\u7684\u590d\u6742\u6027\u4e0d\u65ad\u63d0\u5347\u3002\u60a8\u4e5f\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u7b2c\u4e09\u65b9\u9a8c\u8bc1\u7801\u8bc6\u522b\u670d\u52a1\u6765\u63d0\u9ad8\u6210\u529f\u7387\u3002<\/p>\n<p><strong>\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\u540e\uff0c\u5982\u4f55\u4fdd\u6301\u767b\u5f55\u72b6\u6001\uff1f<\/strong><br \/>\u5728\u6210\u529f\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\u540e\uff0c\u60a8\u9700\u8981\u7ba1\u7406\u4f1a\u8bdd\u4fe1\u606f\uff0c\u4ee5\u4fdd\u6301\u767b\u5f55\u72b6\u6001\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528requests\u5e93\u7684Session\u5bf9\u8c61\u6765\u5b9e\u73b0\u3002Session\u5bf9\u8c61\u5c06\u81ea\u52a8\u4fdd\u5b58\u548c\u7ba1\u7406cookies\uff0c\u786e\u4fdd\u6bcf\u6b21\u53d1\u9001\u8bf7\u6c42\u65f6\u90fd\u643a\u5e26\u6b63\u786e\u7684\u8ba4\u8bc1\u4fe1\u606f\uff0c\u4ece\u800c\u4fdd\u6301\u767b\u5f55\u72b6\u6001\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5982\u4f55\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55 \u5728Python\u4e2d\u6a21\u62dfQQ\u5ba2\u6237\u7aef\u767b\u5f55\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u5b9e\u73b0\uff1a\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u5982r [&hellip;]","protected":false},"author":3,"featured_media":1069725,"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\/1069717"}],"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=1069717"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1069717\/revisions"}],"predecessor-version":[{"id":1069729,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1069717\/revisions\/1069729"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1069725"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1069717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1069717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1069717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}