ChatGPT-assisted analysis

I was looking through a recording of a web page download in my browser's developer tools the other day, and began ticking off a number of calls to third-party domains. Before you know it, I had opened a document and started counting calls to domains, and it occurred to me -- perhaps ChatGPT could help with this.

So, I opened it up and began asking questions:

Are you able to analyze the page load requests of a web site and summarize calls to third-party web sites (with descriptions of those sites)?

And yes, it turns out, it was able to help. It asked me to upload a HAR file (with instructions about how to generate and save it in developer tools), and began to analyze per my request. I went back and forth a couple times, asking for clarification and tweaks, and after four or five rounds, ChatGPT let me know I'd used up my free analysis allocation.

But then, I noticed a little link the bot had been leaving for me, like a trail of breadcrumbs:

This link popped up a code block that contained the actual analysis for each step:

Going all the way back to the beginning of my chat, grabbing these steps, and dropping into a jupyter notebook, I found they ran almost as-is. Just a couple tweaks to the HAR file load locations were needed to make these scripts work in my local environment.

There are defintitely still adjustments you'd make when investigating specific challenges with / for specific web sites, but this experience demonstrates a few powerful principles:

  1. Use of ChatGPT for analysis. This isn't news to most, but I was quite impressed by the speed with which ChatGPT made progress on this problem. With no code written on my part, ChatGPT made enough progress to help me understand more about my problem quite quickly.
  2. Use of ChatGPT for code generation. Seeing the code generation popping out of the analysis steps without having specifically asked for it -- that was new to me, and a very pleasant surprise. Being fairly new to Python development, it was helpful to see this code as examples of the analysis techniques, including...
  3. Use of HAR traces for website analysis. Seeing this chewed up by the example Python code was a helpful illustration of this technique.

If you're interested in seeing a jupyter notebook illustrating this example, you can find it here:
https://github.com/dlambert-personal/gpt_assisted_har_analysis

Leave a Reply

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