This is a very small ChatGPT conversation downloader
Yuki Shindo

Yuki Shindo @shinshin86

About: I love Beatles and Animal Collective and Coding!

Location:
Japan
Joined:
Aug 21, 2020

This is a very small ChatGPT conversation downloader

Publish Date: Jan 11 '23
0 1

Here is some code I wrote for a change of pace.
This is a small script intended to be pasted into the Chrome DevTools console.

I created it because I wanted to keep a text file of my conversations with ChatGPT.

With the ChatGPT page open, paste the following code onto Chrome DevTools and run it.

const download = () => {
  const title = document.querySelector('.pr-14.bg-gray-800').text;

  const textList = []
  document.querySelectorAll('.text-base').forEach((t, i) => {
    textList.push(`${i % 2 === 0 ? "Q:" : "A:"} ${t.textContent}`)
  })
  const text = textList.join('\n');

  const blob = new Blob([text], { type: "text/plain" });
  const url = URL.createObjectURL(blob);

  const a = document.createElement("a");
  a.href = url;
  a.download = title;
  document.body.appendChild(a);
  a.click();

  URL.revokeObjectURL(url);
}
Enter fullscreen mode Exit fullscreen mode

Next, select the conversation you want to download from the left menu.

ChatGPT left menu

After selecting the conversation, execute download() on the console of DevTools to download the content of the conversation as a text file.
The file name will be the title from the selected left menu.

There is one thing to note. This script will not work if the structure of ChatGPT page is updated.

The code is also saved in Gist.

ChatGPT conversation downloader(Gist)

Comments 1 total

  • Bob Martin
    Bob MartinMay 19, 2025

    Thanks a lot for sharing this thing with us. I will try to use the same method for my project that is related to audio and video downloader and you can also visit it from here tubidy.love.

Add comment