New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@pioncorp/scraper

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@pioncorp/scraper

puppeteer scraper

unpublished
latest
npmnpm
Version
0.0.4
Version published
Maintainers
0
Created
Source

Spark Scraper

scraper server using puppeteer

tech stack

  • puppeteer
  • express
  • aws-sdk v3
  • node-schedule

setting

환경변수에 PION_SECRET 을 설정해야함.

  • node : v14.19.3
    • system에 깔려진 version과 pm2 에서 사용하고 있는 version 이 다를 수 있음 (pm2 재시작 필요) --> pm2 update
  • package-lock.json : 해당 파일을 받아서 npm install 로 정해진 library 설치해야됨 안그러면 내용 달라짐.
  • proxyOnOff.js : 해당 파일의 유무에 따라서 proxy on/off

api

  • GET /v4/?url={inputUrl}

    {
        url: String
        inputUrl: String
        protocol: String
        hostname: String
        meta: [{ [key: String]: String }]
        content: String
        innerText: String
        images: [{
            src: String
            width: int?
            height: int?
            naturalWidth: int
            naturalHeight: int
            contentType: String
            contentLength: int
            hash: String
        }]
        childFrames: [{
            url: String
            content: String
            images: [{
                src: String
                width: int?
                height: int?
                naturalWidth: int
                naturalHeight: int
                contentType: String
                contentLength: int
                hash: String
            }]
        }]
    }
    

reference

  • https://pptr.dev/
  • https://intoli.com/blog/saving-images/

테스트

0. 테스트 전 필요 상식

  • 각 티켓의 상태 코드는 다음과 같다.
상태 코드설명
1티켓이 가져가질 준비가 된 상태
2워커가 티켓을 가져감
3워커가 티켓을 작업 완료
4서버가 후처리 이후 완전히 티켓 종료

1. 대시보드를 이용해서 로컬 서버 테스트를 하는 방법

.local 이 호스트 명에 포함될 경우 큐에서 가져오는게 아니라 DB 에서 조회해서 가져온다.

Ref. src/config/config.js

티켓을 공유하고 있기 때문에 유관 작업자들이 로컬 테스트를 할 경우 다른 작업자가 티켓을 가져갈 수 있기 때문에 이를 숙지한 상태에서 테스트를 수행해야 합니다.

  • 로컬에서 서버 실행
  • yarn rundev
  • 대시보드 접속
  • 과거 실행했던 티켓 중 하나를 선택
  • task_scraper 를 클릭
  • 오른쪽 사이드에 나오는 run local test 버튼을 클릭
  • worker name 을 입력(hh)하고 확인 버튼을 클릭
  • 로컬 서버에서 해당 티켓을 가져와서 작업을 수행한다.
  • 대시보드에서 해당 티켓의 상태를 확인하여 테스트가 성공적으로 수행되었는지 확인한다.

Keywords

scraper

FAQs

Package last updated on 10 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts