black binocular on round device
, , , , ,

ChatGPT HTML View

Grab the HTML

I like to use Waterfox. I find it’s faster than Chrome (and Firefox). That said– and I’ve recommended elsewhere here– while I like the browser extension “Copy Cat” by BlackGlory (see Browser page for discussion) because it is able to copy HTML source, sans attributes in one click, it will not do so from a chat with Calculon. The only solution I’ve found to work is an extension called Fire Source Viewer, by Francesco De Stefano. Try that next time you want to copy the HTML source from a ChatGPT session if you’re having trouble there.

RegEx Filter the HTML

Use Regular Expressions, Find and Replace to remove Button, SVG, and Path HTML elements from a ChatGPT session HTML Source View to clean up the code .

Note: These are just quick mock-up expressions I made by copy pasting the HTML source into the free online tool RegExr until it matched everything I wanted to remove. Clearly, these aren’t optimized expressions. I don’t write this stuff for you. Use it if you want to. I’ll clean it when I get around to it.

Since the goal here (so far) is to simply remove elements, there is no “replacement expression”. Just use a blank replacement field in any decent text editor with the regular expressions below, to find the elements.

Remove Button / SVG

Find the SVG encapsulated by the Button element:
/(<button [^>]+)(>)(.*)(<\/svg>)(<\/button>)/
Note: I can’t rem what text editor I was using for this. I might have been CudaText. They have different RegEx engines, you know. Regular expressions that work in one text editor might not work the same in the next. The above does not work in Notepad2, just FYI, but it should get you started. I would not be at all surprised if it fails to work for you (and me) in the future. It might just require some tweaking. OpenAI seems to change the HTML now and then. Not a huge deal.

Remove Path element

Find the <path> element, opening and closing.
/(<path [^>]+)(>)(.*)(<\/path>)/
Note: The good ol’ “remove whatever html element” technique with the negation [^>] works like a charm, here. Unlike above, the dot-all-asterisk atom here didn’t require use of newline and space metacharacters. However, I suppose the element doesn’t have a newline, so… nevermind.

Whatchu do


Leave a Reply

Your email address will not be published. Required fields are marked *