1

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.

2
  • You can use a screenshot App to get the page. SnagIt and Windows Snipping App
    – anon
    Commented Aug 2, 2023 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. Commented Aug 2, 2023 at 22:04

1 Answer 1

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.
4
  • 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
    Commented Aug 10, 2023 at 15:01
  • It didn't when I tested. Could you provide an example?
    – Destroy666
    Commented Aug 10, 2023 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
    Commented Aug 10, 2023 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
    Commented Aug 10, 2023 at 16:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .