ChatGPT share pages hydrate in two branches at once — and "wait for the DOM to settle" won't save your scraper
I build ConvoExport, a small Edge extension that exports a ChatGPT conversation to Markdown, TXT, Word, or PDF by reading the turns straight out of the page DOM. No API, no copy-paste. It sounds simple until you watch a share page actually load.
This is what I measured on a real public share page, with the real extension build (v1.0.2), in headless Chrome 154. The conversation is "Summarize AI safety concerns". The true conversation is 14 turns — 10 from the user, 4 from ChatGPT — and a correct export is 6,264 bytes.
Read it too early and you lose the tail
Open the extension popup about 7 seconds after the page loads and it reads 12 turns (9 + 3), 3,787 bytes. The last two turns simply aren't in the DOM yet. The page looks finished. It isn't.
That part is almost forgivable — a loader that retries fixes it. Mine retries the read every ~2 seconds for up to 15 seconds, and retries the initial ping every ~1 second for up to 8 seconds. But the next failure mode was stranger.
Read it a little later and you get 21 turns
Open the popup once the page text passes 2,000 characters (~15 seconds in) and the same conversation reads as 21 turns, 14,226 bytes — 14 user turns and 7 assistant turns. The conversation doesn't have 21 turns. It has 14.
This is a branched conversation, and during hydration both branches are in the DOM at the same time. Watching the role divs over about 4 seconds: 23, then 21, then 20, then finally 14. The unselected branch is pruned late.
Worse, there is nothing to filter on. I checked four levels of ancestors for each turn: no aria-hidden, no branch test id, no branch class. During that window, the DOM gives you no reliable way to tell which turns belong to the selected branch. Any reader that trusts the DOM in this window will export a conversation that never existed — a mix of two branches, presented as one.
The tempting fix doesn't work either
The obvious fix is "wait until the DOM goes quiet, then read." I ran a probe that logged every read with page age and DOM-quiet time. It found the DOM sitting quiet for 4.5 seconds at 12 turns, at page age 22.6 seconds — while the last two turns still hadn't arrived. A stalled tail request looks exactly like "done" from the DOM's point of view. Quiet is not complete.
What actually gives the exact answer
Wait until the page is genuinely settled — page age past ~35 seconds — and then open the popup. Same share page, same extension build: exactly 14 turns, 10 + 4, 6,264 bytes, byte-identical to the baseline I had measured four days earlier. A second conversation ("Oil recommendation A25A-FKS", 5 turns) came out at exactly 30,636 bytes under the same conditions, also byte-identical to its baseline.
So the rule that holds is boring and specific: on a settled page, the DOM is exact. In the first ~30 seconds after navigation, it can be wrong in both directions — too few turns (tail not yet hydrated) or too many (both branches present) — and no DOM signal reliably tells you which window you're in.
What the extension does with this
ConvoExport v1.0.2 now does all of the following before it presents a conversation:
- retries the content-script ping at ~1s intervals for up to 8s, with a Retry button if that budget runs out;
- retries the read at ~2s intervals for up to 15s while the turn count is still growing or zero;
- requires three consecutive reads with the same turn count before presenting anything;
- requires the DOM to have been quiet for at least 2 seconds;
- applies a page-age gate: on pages younger than 30 seconds, even a stable-looking read gets re-confirmed.
And the honest limit, recorded in the README rather than papered over: inside that ~30-second window after navigation, a read can still come back as 12 or 21 instead of 14. I chose not to make users wait 28 seconds for every export just to close that window. The normal path — opening the popup on a page that's already loaded — is exact, and the transient is documented instead of hidden.
If you scrape ChatGPT share pages (or any heavily hydrated page) and your turn counts occasionally come out wrong in ways you can't reproduce: check whether you're reading during hydration, and check whether the page has branches. "Wait for quiet" is the fix everyone reaches for first. On this page, it fails silently.
ConvoExport is live on Edge (free, 3 exports a day; Pro is a one-time purchase): https://microsoftedge.microsoft.com/addons/detail/akkapiafnelednmcejjeihoggdccbhle