프린트 하기 URL 복사

OS 환경 : Windows 11 (64bit)

 

방법 : 네이버 페이 머니 내역 다운로드 스크립트

네이버 페이를 삼성페이에 연동해 매번 결제를 하는데 이 결제내역을 전체 다운로드 하고싶어서 찾아보니

공식적으로 지원하는 기능은 없어서 제미나이를 이용해 스크립트를 만듦

참고로 현금영수증 내역은 https://pay.naver.com/receipts/history/ 에서 확인 가능함

 

 

네이버 페이 - .NPay 머니 페이지로 이동

 

 

이렇게 머니 결제 내역을 확인 가능함

 

 

이 페이지에서 제일 하단까지 스크롤 한 뒤, 크롬 개발자 콘솔 실행(F12 입력)

이후 아래 스크립트 붙여넣기 후 엔터

만약 allow pasting을 입력하라는 메세지가 나오면

콘솔 찾에 allow pasting 입력 후 엔터를 입력 한 뒤 다시 스크립트를 붙여넣으면됨

 

 

네이버 페이 머니 내역 다운로드용 콘솔 스크립트

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(function() {
    const items = document.querySelectorAll('.History_item-date__1ARLM');
    let results = [['날짜''시간''항목''금액''유형']];
    let currentDate = "";
 
    items.forEach(item => {
        // 날짜 업데이트 (날짜가 있는 행인 경우)
        const dateEl = item.querySelector('.History_date__bIgTt');
        if (dateEl) {
            currentDate = dateEl.innerText.replace('날짜''').trim();
        }
 
        const title = item.querySelector('.History_title__QZYh0')?.innerText.trim() || "";
        const time = item.querySelector('.History_type-time__H5oZ4')?.innerText.replace('시간''').trim() || "";
        const type = item.querySelector('.History_type-sub-title__rhGYG')?.innerText.trim() || "";
        const price = item.querySelector('.History_price___ZdVw')?.innerText.replace('금액''').trim() || "";
 
        if (title) {
            results.push([currentDate, time, title, price, type]);
        }
    });
 
    // CSV 파일 생성 (한글 깨짐 방지를 위해 BOM 추가)
    let csvContent = "\uFEFF" + results.map(e => e.map(field => `"${field}"`).join(",")).join("\n");
    
    // 다운로드 링크 생성
    const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
    const link = document.createElement("a");
    const url = URL.createObjectURL(blob);
    link.setAttribute("href", url);
    link.setAttribute("download""naver_pay_history.csv");
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
})();

 

 

다운로드 폴더에 파일이 받아짐

 

 

파일을 열어보면 내역이 저장된것을 확인할 수 있음

 

 

참조 : 

https://blog.naver.com/sooolimeee/223711032416