informatica:linux:selenium
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatica:linux:selenium [2019/10/17 12:14] – jose | informatica:linux:selenium [2022/12/27 09:08] (current) – jose | ||
|---|---|---|---|
| Line 319: | Line 319: | ||
| ====== Padres e hijos ====== | ====== Padres e hijos ====== | ||
| + | |||
| Tenemos el siguiente código: | Tenemos el siguiente código: | ||
| < | < | ||
| Line 383: | Line 384: | ||
| + | ====== Grabar el contenido de la web en un archivo ====== | ||
| + | ===== Texto ===== | ||
| + | |||
| + | |||
| + | https:// | ||
| + | |||
| + | En mi caso fue muy útil porque no fui capaz, ni con chrome ni con firefox, de obtener el xpath de un popup que al hacer click en cualquier parte se cerraba. | ||
| + | |||
| + | < | ||
| + | html = driver.execute_script(" | ||
| + | with open(" | ||
| + | f.write(html) | ||
| + | </ | ||
| + | |||
| + | ===== Captura de pantalla ===== | ||
| + | |||
| + | < | ||
| + | fichero = f" | ||
| + | driver.set_window_size(1080, | ||
| + | driver.save_screenshot(" | ||
| + | driver.save_screenshot(" | ||
| + | </ | ||
informatica/linux/selenium.1571314493.txt.gz · Last modified: by jose
