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,

CodePudding user response:

reference 1/f, archaeologists lx response:
means that the execution context are destroyed,
Pyppeteer is executing the task, you submit another task, cause a jump of the pyppeteer, for the first time to submit the task of an error,

I know what you mean, I don't understand is why the program ranging from render () method after rendering the page is returned, render () method doesn't look like asynchronous method,

CodePudding user response:

Is asynchronous, based on asyncio

Selenium is asynchronous,

CodePudding user response:

reference archaeologists lx reply: 3/f
is asynchronous, based on asyncio,
Selenium is asynchronous,

Render () method is not asynchronous, it not, at the beginning of the definition of async, arender () method is asynchronous,
  • Related