chrome headless 모드

2
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"  --headless --disable-gpu --dump-dom  "https://www.naver.com/"
-> 이렇게 실행해도 아무것도 안보인다.

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"  --headless --disable-gpu --enable-logging --dump-dom  "https://www.naver.com/"
-> --enable-logging 를 추가해야 내용이 출력된다.

동작시키면
[0328/140120.530:ERROR:mf_helpers.cc(14)] Error in dxva_video_decode_accelerator_win.cc in line 542
같은 에러가 나온다. --disable-gpu 플래그를 줘도 그러네...


  • pdf 로 저장
    • 페이지의 모든 부분이 pdf로 저장된다.
    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"  --headless --disable-gpu  --print-to-pdf=C:\Temp\output.pdf     "https://www.naver.com/"

  • png로 저장
    • 특정 크기의 부분이 png로 저장된다.
      • 기본 크기는 800x600
      • --window-size=1280,1696  를 추가해서 너비 높이 설정 가능
    • --hide-scrollbars 스크롤바 감추기
    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"  --headless --disable-gpu  --screenshot=C:\Temp\screenshot.png     "https://www.naver.com/"
    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"  --headless --disable-gpu --window-size=1280,1696  --screenshot=C:\Temp\screenshot2.png     "https://www.naver.com/"
    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"  --headless --hide-scrollbars --screenshot=C:\Temp\screenshot3.png     "https://www.naver.com/"


댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -
목록형 📷 갤러리형
제목
[기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js)
유용한 리눅스(LINUX) 명령어
[공지] 기술 게시판
6.29
6.30
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7.10
7.11
7.12
7.13
7.14
7.15
7.16
7.17
7.18
7.19
7.20
7.21
7.22
7.23
7.24
7.25
7.26
7.27
7.28
7.29
7.30
7.31
8.1
8.2