アンチボット画面バイパス

- クッキー
- ブラウザのフィンガープリント
- メイン ウィンドウ フレームから行われた最後の HTTP 要求のヘッダー
このテクノロジーは アンチゲート テンプレート に基づいて構築されていますが、テンプレートを自社で管理し、常に最新の状態に維持しています。このタイプのタスクを使用するには、各タスクに 5 クレジットのコストで サブスクリプション が必要です。サブスクリプションの価格は月額 $9.90 からで、5,000 回のバイパスが含まれています。テンプレートを購入したくない場合は、この チュートリアル を使用して自分でテンプレートを作成し、タスクごとに約 0.002 ドルの費用で残高から支払いを続けることができます。
高品質のプロキシのみが受け入れられ、ホスト名、「レジデンシャル プロキシ」、共有プロキシ プールはありません。米国/ヨーロッパで VPS をレンタルし、指示 を使用して SQUID サーバーをインストールすることは常に機能します。タスクの実行前に、プロキシの速度と互換性がチェックされます。応答時間が 1 秒未満である必要があります。そうしないと、ワーカーがタスクをキャンセルします。
Web サイトがアンチボット画面をサポートしているかどうかを確認します。
なお、一部のボット対策画面では、SSL handshake fingerprintingのような高度なフィンガープリント技術を使用しており、どの種類のSSL/TLSクライアントがウェブサイトに接続しているかを識別することができます。例えば、Chromeブラウザはあるフィンガープリントを持ち、Firefoxは別のフィンガープリント、CURLは全く別のフィンガープリントを持っています。User-Agentと混同しないでください。この場合、私たちのサービスを利用するためには、ワーカーのセッションを再構築するために、同じブラウザのインスタンスを使用する必要があります。ワーカーの多くはChromeブラウザを使っているので、NodeJS+Puppeteer+ChromiumまたはSelenium+Chromedriverのバンドルがその役割を果たします。例としては、以下のようなものがあります。
タスクオブジェクト
プロパティ | タイプ | 必須 | 目的 |
---|---|---|---|
type | 文字列 | はい | AntiBotCookieTask |
websiteURL | 文字列 | はい | ワーカーがアクセスするターゲットウェブページのアドレス。 |
proxyAddress | 文字列 | はい | プロキシIP アドレスipv4/ipv6。ローカルネットワークからのホスト名またはIPアドレスがありません。 |
proxyPort | 整数 | はい | プロキシポート |
proxyLogin | 文字列 | はい | 許可が必要なプロキシのログイン(基本) |
proxyPassword | 文字列 | はい | プロキシパスワード |
リクエスト例
#pip3 install anticaptchaofficial
from anticaptchaofficial.antibotcookietask import *
import requests
solver = antibotcookieTask()
solver.set_verbose(1)
solver.set_key("API_KEY_HERE")
solver.set_website_url("https://www.somewebsite.com/")
solver.set_proxy_address("1.2.3.4")
solver.set_proxy_port(3128)
solver.set_proxy_login("login")
solver.set_proxy_password("password")
# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
solver.set_soft_id(0)
result = solver.solve_and_return_solution()
if result == 0:
print("could not solve task")
exit()
print(result)
cookies, localStorage, fingerprint = result["cookies"], result["localStorage"], result["fingerprint"]
if len(cookies) == 0:
print("empty cookies, try again")
exit()
cookie_string = '; '.join([f'{key}={value}' for key, value in cookies.items()])
user_agent = fingerprint['self.navigator.userAgent']
print(f"use these cookies for requests: {cookie_string}")
print(f"use this user-agent for requests: {user_agent}")
s = requests.Session()
proxies = {
"http": "http://login:password@1.2.3.4:3128",
"https": "http://login:password@1.2.3.4:3128"
}
s.proxies = proxies
content = s.get("https://www.somewebsite.com/", headers={
"Cookie": cookie_string,
"User-Agent": user_agent
}).text
print(content)
タスクソリューションオブジェクト
プロパティ | タイプ | 目的 |
---|---|---|
cookies | オブジェクト | アンチボット画面の背後にあるページからの Cookie。それらをすべて結合して、HTTP 要求で使用します。 |
localStorage | オブジェクト | Cookieと同様に、最後のページで取得されたlocalStorage値を持つオブジェクト。 |
fingerprint | オブジェクト | ブラウザフィンガープリントパラメータ。CookieおよびlocalStorageと一緒に使用して、ソフトウェアでワーカーブラウザーセッションを再作成します。 HTTP リクエストで self.navigator.userAgent 値をユーザー エージェントとして使用します。 |
url | 文字列 | テンプレートの実行が終了したページのURL |
lastRequestHeaders | 配列 | ブラウザーのメイン ウィンドウ フレームから Web サイトに送信された最後の要求ヘッダー。 |
レスポンス例
{
"errorId": 0,
"status": "ready",
"solution": {
"cookies": {
"some_antibotcookie": "0A8VO9NX5N1s4LRoS4sJlFTCNzLj0dEfA_2whUh0E6ZjgQtM~I1cV7U2IhQx0~jnowNjg-Oi76b-MjYPd1GQAmIxh5-v~33PI8F",
"maybe_another_id": "join_all_cookies_together"
},
"localStorage": {
"some_value": "Might be used too in the future as a method to 'remember' visitors, so we collect it too.",
"what_is_it": "localStorage is a more complex analogue of cookies, allowing to store larger objects in browser memory"
},
"fingerprint": {
"self.navigator.userAgent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/101.0.0.0 Safari\/537.36",
"self.screen.width": 1280,
"self.screen.height": 768,
"self.screen.availWidth": 1280,
"self.screen.availHeight": 768,
"self.screen.availLeft": 0,
"self.screen.availTop": 25,
"self.navigator.vendorSub": "",
"self.navigator.productSub": "20030107",
"self.navigator.vendor": "Google Inc.",
"self.navigator.maxTouchPoints": 0,
"self.navigator.hardwareConcurrency": 8,
"self.navigator.cookieEnabled": true,
"self.navigator.appCodeName": "Mozilla",
"self.navigator.appName": "Netscape",
"self.navigator.appVersion": "5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/101.0.0.0 Safari\/537.36",
"self.navigator.platform": "MacIntel",
"self.navigator.product": "Gecko",
"self.navigator.language": "en-US",
"self.navigator.onLine": true,
"self.navigator.deviceMemory": 4
},
"url": "https://www.thewebsite.com/some/final/path/after_redirects",
"lastRequestHeaders": [
"sec-ch-device-memory: 8",
"sec-ch-ua: \" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"",
"sec-ch-ua-mobile: ?0",
"sec-ch-ua-arch: \"x86\"",
"sec-ch-ua-platform: \"macOS\"",
"sec-ch-ua-model: \"\"",
"sec-ch-ua-full-version-list: \" Not A;Brand\";v=\"99.0.0.0\", \"Chromium\";v=\"101.0.5005.115\", \"Google Chrome\";v=\"101.0.5005.115\"",
"Upgrade-Insecure-Requests: 1",
"User-Agent: Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/101.0.0.0 Safari\/537.36",
"Accept: text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/avif,image\/webp,image\/apng,*\/*;q=0.8,application\/signed-exchange;v=b3;q=0.9",
"Sec-Fetch-Site: same-origin",
"Sec-Fetch-Mode: navigate",
"Sec-Fetch-Dest: document",
"Referer: https:\/\/somewebsite.com\/",
"Accept-Encoding: gzip, deflate, br",
"Accept-Language: en-US,en;q=0.9",
"Cookie: some_antibotcookie=0A8VO9NX5N1s4LRoS4sJlFTCNzLj0dEfA_2whUh0E6ZjgQtM~I1cV7U2IhQx0~jnowNjg-Oi76b-MjYPd1GQAmIxh5-v~33PI8F"
]
},
"cost": "0.00858",
"ip": "5.25.11.114",
"createTime": 1637841143,
"endTime": 1637841189,
"solveCount": 0
}