Chrome Devtools Protocol with BiDi API
Usage
A seguinte lista de APIs crescerá à medida que o projeto Selenium se prepara para suportar casos de uso do mundo real. Se houver funcionalidades adicionais que você gostaria de ver, por favor, levante uma solicitação de recurso.
As these examples are re-implemented with the WebDriver-Bidi protocol, they will be moved to the WebDriver Bidi pages.
Examples
Basic authentication
Alguns aplicativos fazem o uso da autenticação do navegador para proteger suas páginas. Com o Selenium, você pode automatizar a entrada de credenciais básicas de autenticação sempre que for necessário.
Alternate implementations can be found at CDP Endpoint Basic Authentication and CDP API Basic Authentication
An alternate implementation may be found at CDP Endpoint Basic Authentication
Pin scripts
This can be especially useful when executing on a remote server. For example, whenever you check the visibility of an element, or whenever you use the classic get attribute method, Selenium is sending the contents of a js file to the script execution endpoint. These files are each about 50kB, which adds up.
Mutation observation
Mutation Observation(Observação de Mutação) é a capacidade de capturar eventos via WebDriver BiDi quando há mutações DOM em um elemento específico no DOM.
Console logs and errors
Vigie os eventos console.log
e registre os callbacks(retornos de chamada) para processar o evento.
CDP API Console logs and WebDriver BiDi Console logs
Use the WebDriver BiDi Console logs implementation. HasLogEvents
will likely end up deprecated because it does not implement Closeable
.
JavaScript exceptions
Vigie as exceções JS e registre callbacks(retornos de chamada) para processar os detalhes da exceção.
Use the WebDriver BiDi JavaScript exceptions implementation
Interceptação de Rede
Both requests and responses can be recorded or transformed.