I am transitioning my work from using an undetectable Chrome driver to using the nodriver library (https://github.com/ultrafunkamsterdam/nodriver). I need help handling alerts, as I couldn’t find relevant information in the API documentation.
Here is a specific example of what I want to achieve:
- Click a button.
- Wait for an alert to appear within a specified time (e.g., 10 seconds).
- If an alert appears within the specified time:
- Print the alert text.
- Accept the alert.
- If no alert appears within the specified time, do nothing.
Could you provide guidance or a code example on how to accomplish this using nodriver?