사용자 지정 쿠키
Wsa-Cookie 요청 헤더를 전송하여 스크래핑에 사용자 지정 쿠키를 첨부할 수 있습니다. API는 브라우저에서 전송하는 것과 동일한 방식으로 해당 쿠키를 대상 사이트로 전달합니다.
Endpoint
섹션 제목: “Endpoint” GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>
Parameters
섹션 제목: “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | Web Scraping API 키 |
url | string | yes | 가져올 대상 URL |
Wsa-Cookie (header) | string | no | 세미콜론으로 구분된 쿠키 문자열, 예: name1=value1; name2=value2. |
Example request
섹션 제목: “Example request”curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=http%3A%2F%2Fhttpbin.org%2Fcookies" \ -H "Wsa-Accept: application/json" \ -H "Wsa-Cookie: name1=value1; name2=value2"import requests
r = requests.get( "https://scrape.shifter.io/v1", params={"api_key": "YOUR_API_KEY", "url": "http://httpbin.org/cookies"}, headers={ "Wsa-Accept": "application/json", "Wsa-Cookie": "name1=value1; name2=value2", },)print(r.json())import fetch from 'node-fetch';
const url = 'https://scrape.shifter.io/v1?' + new URLSearchParams({ api_key: 'YOUR_API_KEY', url: 'http://httpbin.org/cookies',});const res = await fetch(url, { headers: { 'Wsa-Accept': 'application/json', 'Wsa-Cookie': 'name1=value1; name2=value2', },});console.log(await res.json());Example response
섹션 제목: “Example response”{ "cookies": { "name1": "value1", "name2": "value2" }}