Get HTML document as string before it has loaded
问题 I looked at this and this answer to that question, but they only get the HTML contents of the page up until the <script> that executes the code. For example, in this snippet: <!DOCTYPE html> <html> <head> <title>Test</title> <script type="text/javascript"> console.log(new XMLSerializer().serializeToString(document)); </script> <link type="text/css" rel="stylesheet" href="style.css"> </head> <body> <script type="text/javascript" src="testscript1.js"></script> <script type="text/javascript" src