Home > other > Request - HTML rendering website immediately after performing operations complains, must wait for 1
Request - HTML rendering website immediately after performing operations complains, must wait for 1
Time:10-29
Because of the need to execute JavaScript code, so use the Requests - HTML library, After get a response, you can use "response. HTML. Render ()" execute JavaScript code in web pages, but if the render () method has no parameters "sleep=1", immediately after the response to perform operations (such as the response. HTML. Find the selector ()), the program will be an error is as follows: Pyppeteer.errors.Net workError: Execution context was destroyed, most likely because of a navigation. I know this will solve the problems such as 1 ~ 2 seconds, but I want to know the cause of this error, really don't want to see the source code, which a great god knows?
CodePudding user response:
Mean the execution context are destroyed, Pyppeteer is executing the task, you submit another task, cause a jump of the pyppeteer, submit task error for the first time,