您好,登錄后才能下訂單哦!
小編給大家分享一下python如何實現騰訊滑塊驗證碼識別,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
python的五大特點:1.簡單易學,開發程序時,專注的是解決問題,而不是搞明白語言本身。2.面向對象,與其他主要的語言如C++和Java相比, Python以一種非常強大又簡單的方式實現面向對象編程。3.可移植性,Python程序無需修改就可以在各種平臺上運行。4.解釋性,Python語言寫的程序不需要編譯成二進制代碼,可以直接從源代碼運行程序。5.開源,Python是 FLOSS(自由/開放源碼軟件)之一。
參考:https://janikarhunen.fi/how-to-install-python-3-6-1-on-centos-7
sudo yum install https://centos7.iuscommunity.org/ius-release.rpm sudo yum install python36u python3.6 -V sudo yum install python36u-pip sudo yum install python36u-devel
python3.6 -m venv venv . venv/bin/activate pip install [package_name] # 安裝依賴 pip install -r requirements.txt
# 參考 https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uswgi-and-nginx-on-ubuntu-18-04 # Install the latest stable release: pip install uwsgi # ... or if you want to install the latest LTS (long term support) release, pip install https://projects.unbit.it/downloads/uwsgi-lts.tar.gz # 創建ln cp captcha.service /etc/systemd/system/captcha.service systemctl enable captcha.service systemctl start captcha.service
uwsgi --ini /usr/local/nginx/html/myblog/uwsgiconfig.ini #后臺運行 uwsgi --ini /usr/local/nginx/html/myblog/uwsgiconfig.ini --daemonize /usr/local/nginx/html/myblog/myblog.out
location /tx/ { add_header Access-Control-Allow-Origin *; include uwsgi_params; uwsgi_pass 127.0.0.1:8008; }
請求圖片識別和加速度模擬
http://127.0.0.1:5000/tx/image POST /tx/image HTTP/1.1 Host:host Content-Type: application/json Accept: */* Cache-Control: no-cache Accept-Encoding: gzip, deflate Content-Length: 1055 Connection: keep-alive cache-control: no-cache { "url": "圖片的地址" } 返回數據 { "data": { "list": [],//模擬的點 "url": "",//圖片地址 "x": 515,// x軸的偏移量 }, "message": "解析成功" }
const slider = {width: 680, point: 0, move: 0, steps: 0, posX: 0};//原本的高度 //開始計算移動的距離 slider.point = bgSize.width / slider.width * x; slider.move = handle.x + slider.point - 5; slider.steps = Math.random() * 100 / 30 + 100; slider.posX = handle.x + handle.width / 2; logger.info(`開始識別和移動滑塊`, slider); //滑塊的位置 await page.mouse.move(slider.posX, handle.y + handle.height / 3, {steps: slider.steps}); await page.mouse.down(); let val = handle.x; for (let i = 0; i < traces.length; i++) { val += bgSize.width / slider.width * (traces[i]);//縮放距離 slider.move = val; if (val <= slider.posX) continue; await page.mouse.move(slider.move, handle.y + handle.height / 2 + 5); } await page.waitFor(100); await page.mouse.up();
驗證碼識別成功后悔返回驗證識別結果的Ticket
看完了這篇文章,相信你對“python如何實現騰訊滑塊驗證碼識別”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。