User Tools

Site Tools


informatica:linux:selenium

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
informatica:linux:selenium [2020/05/08 09:17] – [Padres e hijos] javiinformatica:linux:selenium [2022/12/27 09:08] (current) jose
Line 385: Line 385:
  
 ====== Grabar el contenido de la web en un archivo ====== ====== Grabar el contenido de la web en un archivo ======
 +
 +===== Texto =====
 +
  
 https://stackoverflow.com/a/50420667/2695864 https://stackoverflow.com/a/50420667/2695864
Line 395: Line 398:
     f.write(html)     f.write(html)
 </code> </code>
 +
 +===== Captura de pantalla =====
 +
 +<code>
 +fichero = f"{datetime.datetime.now():%Y%m%d_%H%M%S}"
 +driver.set_window_size(1080,1800)
 +driver.save_screenshot("captura.png")
 +driver.save_screenshot("captura_" + fichero + ".png")
 +</code>
 +
informatica/linux/selenium.txt · Last modified: 2022/12/27 09:08 by jose