Bắt đầu

Giải thích tham số

Tham sốKiểuMô tả
actorstringMột tham số rất quan trọng, nó đại diện cho một dịch vụ. Nhấp để xem thông tin danh sách scraper actor
inputobjectCác tham số mà actor cần để hoàn thành một tác vụ scraping dữ liệu.
proxyobjectTrường country, sử dụng proxy từ khu vực này để gửi yêu cầu.

Giải thích trường Input

Tham sốKiểuMặc địnhMô tả
urlstringTrang web mục tiêu
methodstringGETPhương thức yêu cầu
redirectbooleanfalseCó cho phép chuyển hướng hay không
headersobjectCác trường header yêu cầu tùy chỉnh

Gửi yêu cầu đầu tiên

Sử dụng ví dụ scraping dữ liệu của https://httpbin.io/get.

Thu thập dữ liệu qua API Endpoint

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);
  });