Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

316
Visualizações
how to interact with shadow DOM elements for take the file.pdf with selenium 4.x, using php and chrome driver V95.0.?

Explain better: I am automating the issuance of a certificate that is being generated in iframes

Through the selenium grid I managed to get to this last screen where the pdf is selenium_grid I tried to print the screen with window.print running a javascript, I see the window for print but I couldn't proceed :

$this->driver->executeScript("window.print()");






document.querySelector('pdf-viewer').shadowRoot.querySelector('viewer-toolbar').shadowRoot.querySelector('viewer-download-controls').shadowRoot.querySelector('cr-icon-button').click();//this work in browser, nope with selenium

From where I am I think there could be some ways to solve which I tried but didn't make any progress:

  • after windows.print() ,

    • press o key enter, maybe(two times),
    • click button save
  • maybe using keyboard control + s , key enter

  • right click, save page as, confirm

  • maybe using control + p

  • maybe using mouse for click in arrow down for download, but I got not find element, or dont know how to use coordinates for mouse

  • set preferences/capabilities for browser for when the window.print() not show where I liked save my pdf I too tried set a preferences I too tried $this->driver->getPageSource();

    $options->addArguments(['--print-to-pdf']);

that I find here but not sure if it is working or how to use it.

<iframe src="asintegrarelatorio?UGsAuJNIMg0Bs79efCz_UN+WLY3wJLa3shybBaN2MhtwcBuQ28HYLHZjlWoShKh3akHt0HZM3+pL7TP3ksZMQQ==" name="EMBPAGE" width="900px" height="500px" frameborder="1" align="center" title="" style="" scrolling="auto">
<html><head><script src="chrome-extension://mooikfkahbdckldjjndioackbalphokd/assets/prompt.js"></script></head><body style="height: 100%; width: 100%; overflow: hidden; margin:0px; background-color: rgb(82, 86, 89);"><embed name="C065A881B0E7E51799DF65DCF351573F" style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="about:blank" type="application/pdf" internalid="C065A881B0E7E51799DF65DCF351573F"></body></html>


</iframe>

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda