0

I need to save what's already in the DOM, without triggering a reload or re-executing JavaScript. Is this possible? I don't care if a specific browser is required.

The problem is that I have to record the contents of a page that I see after filling in a reCAPTCHA. So, for the sake of argument, I fill in the reCAPTCHA, and I see a table. How do I save that table locally? I don't need any styling or the CSS - just the HTML.

The things I've tried:

  1. 'Save As'. If I save as a single web page, I normally get the correct data. However, sometimes I just get a reCAPTCHA challenge instead

  2. View the page source. This always shows the correct page. I can then attempt to save the page source, but I get exactly the same problem as before. Note this answer, which says that this should work, but I agree with the OP that it doesn't (consistently)

  3. View the page source, and copy-and-paste the HTML. This always works, of course, but is too difficult to do for a few hundred pages. Similarly, getting the source from the dev tools is too difficulty (this procedure has to be carried out by a non-technical user)

If I turn on the dev tools in either Firefox or Chrome, there's no network activity for a page save for (1) or (2), so it appears that the browser isn't attempting to re-fetch the page. However, this doesn't really make sense, so I assume it's re-fetching under the hood.

EML
  • 453
  • 1
  • 5
  • 12
  • You can use a screenshot App to get the page. SnagIt and Windows Snipping App – John Aug 02 '23 at 21:39
  • Or press Ctrl-P and select *Save as PDF* in Firefox. The page is saved as-is, and the Firefox *Save to PDF* give control over the page appearance. – DrMoishe Pippik Aug 02 '23 at 22:04

1 Answers1

0

You can use an extension like Save Page WE which lets you save what's currently visible.

  1. Scroll to the bottom of the page as recommended by the author for higher accuracy.
  2. Right mouse button on the page -> Save Page WE -> Save Selected Tabs -> e.g. Standard Items
  3. Choose location of the .html file.
Destroy666
  • 5,299
  • 7
  • 16
  • 35
  • Sorry, been on holiday. Checking it now, but my first reaction is that it does a page load, so doesn't address the problem. – EML Aug 10 '23 at 15:01
  • It didn't when I tested. Could you provide an example? – Destroy666 Aug 10 '23 at 15:08
  • Haven't tried it yet - I'm basing my comment on one of the reviews which says that it "repeated Ajax requests". If true, this would make it unusable. There is at least one extension which claims to save the DOM ('Copy DOM Content') but it has minimal documentation and no reviews, so I won't be trying it – EML Aug 10 '23 at 15:31
  • Well, it saved a solved recaptcha and filled form fields for me, for instance, so not too sure about repeating requests. Please don't base on random comments on the internet, which might not only be outdated, but also just lies. When you'll test it yourself, let me know about use case that doesn't work. – Destroy666 Aug 10 '23 at 16:21