Answer the question
In order to leave comments, you need to log in
How to catch No node found for selector error in pyppeteer?
Yandex parser. Sometimes the page does not have time to load and there is no input line on it. An error occurs:
No node found for selector: input[name=text]
at this location:
But the code is asynchronous and it's just text output. How to catch it as an error?
await page.focus('input[name=text]')
Answer the question
In order to leave comments, you need to log in
You though in traceback of an error looked, the exception which is caused is written there. You import it and process it. In your case it is:
from pyppeteer.error import PageError
try:
...
except PageError:
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question