본문으로 건너뛰기

자동화

Puppeteer와 Playwright를 프로필에 바로

열려 있는 프로필마다 전용 디버깅 주소가 있습니다. 바로 그 프로필에 코드를 연결하세요. 지문도 쿠키도 프록시도 그대로입니다. 무료 요금제를 포함한 모든 요금제에 들어 있습니다.

  1. 1앱에서 로컬 인터페이스를 켜세요. 설정의 «로컬 API»에서 키를 복사합니다.
  2. 2프로필을 열어 달라고 요청하세요. 응답에는 그 프로필만의 주소가 들어 있습니다.
  3. 3그 주소에 평범한 브라우저처럼 코드를 연결하세요.
  4. 4평소대로 작업하세요. 지문과 쿠키와 프록시는 이미 자리에 있습니다.

JavaScript (puppeteer-core)

const puppeteer = require('puppeteer-core');

(async () => {
  // 1. Ask the app for this profile's debugging endpoint.
  const started = await fetch(
    'http://127.0.0.1:50325/api/v1/browser/start?profileId=YOUR_PROFILE_ID',
    { method: 'POST', headers: { 'x-api-token': 'YOUR_API_TOKEN' } },
  ).then((r) => r.json());

  // 2. Attach to it like to any other browser.
  const browser = await puppeteer.connect({
    browserWSEndpoint: started.data.ws,
    defaultViewport: null,
  });

  const [page] = await browser.pages();
  await page.goto('https://example.com');
})();

Python (Playwright)

import requests
from playwright.sync_api import sync_playwright

# 1. Ask the app for this profile's debugging endpoint.
started = requests.post(
    "http://127.0.0.1:50325/api/v1/browser/start",
    params={"profileId": "YOUR_PROFILE_ID"},
    headers={"x-api-token": "YOUR_API_TOKEN"},
).json()

# 2. Attach to it like to any other browser.
with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(started["data"]["ws"])
    page = browser.contexts[0].pages[0]
    page.goto("https://example.com")

연결하기 전에 알아두실 것

Puppeteer and Playwright turn on Runtime.enable and Page.enable the moment they attach. Runtime.enable puts observers inside Chromium that page scripts can notice. Our own automation builder never turns it on. It turns on Page.enable only while a flow runs, on the tabs the flow uses, so it can answer a page's alert or confirm; a test page that looks for traces saw nothing from it on either engine. If the site you work with checks for this, build the sequence in the app instead.

코드 없이 만들 수도 있습니다

창 안에서 열여섯 가지 단계: 열기, 누르기, 입력, 기다리기, 읽기, 분기. 감지될 관찰자도 없고 설치할 것도 없습니다.

앱이 할 수 있는 일 보기