python uses execjs and jsdom to execute js code solutions containing documents and set environment variables

Let’s talk about the environment first: win7 64-bit, python3.8.10. When python uses execjs to execute js code containing document, an error will appear: execjs._exceptions.ProgramError: TypeError: ‘document’ is undefined The reason is that pure js code does not contain objects in the browser (such as document, window, etc.). In this case, a library called jsdom is […]