Skip to content
On this page
Home
>タスク(トークン)
>AwsWaf

AwsWafCaptcha: AwsWafの解決

createTaskメソッドでタスクを作成し、getTaskResultメソッドで結果を取得します。

サポートするタスクタイプ types:

  • AntiAwsWafTask このタスクタイプは独自のプロキシが必要です。
  • AntiAwsWafTaskProxyLess このタスクタイプは独自のプロキシは必要ありません。

タスクの作成

createTaskメソッドを使用して認識タスクを作成します。

タスクオブジェクト構造

プロパティタイプ必須説明
typeStringRequiredAntiAwsWafTask
AntiAwsWafTaskProxyLess
websiteURLStringRequiredキャプチャ情報を返すページのURL
awsKeyOptionalRequiredwebsiteURLページが返すステータスコードが405の場合、awsKeyを渡す必要があります
awsIvOptionalRequiredwebsiteURLページが返すステータスコードが405の場合、awsIvを渡す必要があります
awsContextOptionalRequiredwebsiteURLページが返すステータスコードが405の場合、awsContextを渡す必要があります
awsChallengeJSOptionalRequiredwebsiteURLページが返すステータスコードが202の場合、awsChallengeJsのみを渡す必要があります;
proxyStringRequiredプロキシの使用を学びます

WARNING

取得したトークンが利用できない場合、IPの問題がある可能性があります。自分のプロキシを渡すには、AntiAwsWafTaskモードを使用してみてください。

例のリクエスト

json
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json

{
    "clientKey": "YOUR_API_KEY",
    "task": {
        "type": "AntiAwsWafTask", // 必須
        "websiteURL": "https://efw47fpad9.execute-api.us-east-1.amazonaws.com/latest", // 必須
        "proxy": "http:ip:port:user:pass" // socks5:ip:port:user:pass // オプション
    }
}

タスクを提出した後、成功した場合はレスポンスで 'タスクID' を受け取るはずです。タスクIDを受け取らなかった場合は、エラーコード:エラーの完全なリストを読んでください。

例のレスポンス

json
{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

結果の取得

タスクIDを取得したら、タスクIDを提出して解決策を取得する必要があります。レスポンス構造はgetTaskResultで説明されています。

システムの負荷に応じて、結果を取得するまでの間隔は 5秒 から 30秒 までです。

例のリクエスト

json
POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json

{
    "clientKey": "YOUR_API_KEY",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

例のレスポンス

json
{
  "errorId": 0,
  "taskId": "646825ef-9547-4a29-9a05-50a6265f9d8a",
  "status": "ready",
  "solution": {
    "cookie": "223d1f60-0e9f-4238-ac0a-e766b15a778e:EQoAf0APpGIKAAAA:AJam3OWpff1VgKIJxH4lGMMHxPVQ0q0R3CNtgcMbR4VvnIBSpgt1Otbax4kuqrgkEp0nFKanO5oPtwt9+Butf7lt0JNe4rZQwZ5IrEnkXvyeZQPaCFshHOISAFLTX7AWHldEXFlZEg7DjIc="
  }
}

SDKリクエストの使用

python
# pip install --upgrade capsolver
# export CAPSOLVER_API_KEY='...'

import capsolver

# capsolver.api_key = "..."
solution = capsolver.solve({
    "type": "AntiAwsWafTask",
    "websiteURL": "https://efw47fpad9.execute-api.us-east-1.amazonaws.com/latest",
    "proxy": "ip:port:user:pass"
})
go
package main

import (
	"fmt"
	capsolver_go "github.com/capsolver/capsolver-go"
	"log"
)

func main() {
	// 最初にSDKをインストールする必要があります
	//go get github.com/capsolver/capsolver-go
	//export CAPSOLVER_API_KEY='...' または
	//capSolver := CapSolver{ApiKey:"..."}

	capSolver := capsolver_go.CapSolver{}
	solution, err := capSolver.Solve(map

[string]any{
		"type": "AntiAwsWafTaskProxyLess",
		"websiteURL": "AntiAwsWafTask",
		 "proxy":"ip:port:user:pass"
	})
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println(solution)
}