How to download your direct messages in your PC browser.
You can refresh the screen to redo from the beginning.
- Go to https://www.instagram.com/direct/t/{numbers}, which you want to download in your PC browser.
- Open JavaScript console via 'Inspect' in your browser.
- Run this code for auto scrolling.
timer = setInterval(() => {
document.getElementsByClassName('frMpI -sxBV')[0].scrollBy(0, -window.innerHeight);
}, 100)
- Stop auto scrolling.
clearInterval(timer);
- Download messages as text file
out = document.getElementsByClassName('VUU41')[0].innerText
let blob = new Blob([out],{type:"text/plan"});
let link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = 'out.txt';
link.click();
途中で失敗したら、ブラウザの更新ボタンを押して、やり直してください。
- PCブラウザで保存したいDM画面を開きます。https://www.instagram.com/direct/t/[番号]
- ブラウザの検証機能を開き、コンソール画面を開きます。
- 以下のコードを実行して、保存したいところまで遡ります。(量が多いと時間かかります)
timer = setInterval(() => {
document.getElementsByClassName('frMpI -sxBV')[0].scrollBy(0, -window.innerHeight);
}, 100)
- 保存したいところまで来たら、以下のコードで止めます。
clearInterval(timer);
- テキストファイルとして保存します。
out = document.getElementsByClassName('VUU41')[0].innerText
let blob = new Blob([out],{type:"text/plan"});
let link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = 'out.txt';
link.click();