はじめに
パラメータの説明
パラメータ | 型 | 説明 |
---|---|---|
actor | string | 非常に重要なパラメータで、サービスを表します。スクレイパーのアクターリスト情報を表示するにはクリックしてください |
input | object | データスクレイピングタスクを完了するためにアクターが必要とするパラメータ。 |
proxy | object | country フィールド。この地域のプロキシを使用してリクエストを送信します。 |
input フィールドの説明
パラメータ | 型 | デフォルト | 説明 |
---|---|---|---|
url | string | ターゲットウェブサイト | |
method | string | GET | リクエストメソッド |
redirect | boolean | false | リダイレクトを許可するかどうか |
headers | object | カスタムリクエストヘッダーフィールド |
最初のリクエストを送信する
https://httpbin.io/get
のデータスクレイピングを例として使用します。
API エンドポイント経由でデータを取得する
import { Scrapeless } from '@scrapeless-ai/sdk';
const client = new Scrapeless({
apiKey: 'YOUR_API_KEY'
});
client.universal.scrape({
actor: "unlocker.webunlocker",
input: {
url: "https://httpbin.io/get",
redirect: False,
method: "GET",
},
proxy: {
country: "ANY",
}
}).then(async (result) => {
console.log(result);
})
.catch((error) => {
console.error('Error:', error);
});