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
Next revision
Previous revision
Next revisionBoth sides next revision
informatica:linux:selenium [2019/09/23 19:29] joseinformatica:linux:selenium [2019/09/24 07:20] – [Python firefox headless local] javi
Line 146: Line 146:
  
 ====== Python firefox headless local ====== ====== Python firefox headless local ======
 +
 +===== Sin profile =====
 +
  
 **IMPORTANTE**: si no se especifica el tamaño de la pantalla puede no encontrar objetos en el DOM. **IMPORTANTE**: si no se especifica el tamaño de la pantalla puede no encontrar objetos en el DOM.
Line 157: Line 160:
 from selenium.webdriver import Firefox from selenium.webdriver import Firefox
  
-        options = Options() +# Local headless 
-        options.add_argument('-headless') +options = Options() 
-        = Firefox(options = options) +options.headless = True 
-        d.set_window_size(19201080+driver = Firefox(options = options) 
-        return d+</code> 
 + 
 +===== Con profile ===== 
 + 
 +<code> 
 +from selenium.webdriver.firefox.options import Options 
 +from selenium.webdriver import FirefoxFirefoxProfile 
 + 
 +# Local headless 
 +options = Options(
 +options.headless = True 
 +driver = Firefox(firefox_profile = profile, options = options)
 </code> </code>
  
Line 269: Line 283:
 </code> </code>
  
-===== Whatsapp ===== +====== Whatsapp ====== 
-==== Enviar mensaje ====+===== Enviar mensaje =====
  
 <code> <code>
Line 285: Line 299:
 o.click() o.click()
 </code> </code>
-==== Adjuntar fichero ====+===== Adjuntar fichero =====
 <code> <code>
 xpath = './/span[contains(@title, "Armando Bronca")]' xpath = './/span[contains(@title, "Armando Bronca")]'
informatica/linux/selenium.txt · Last modified: 2022/12/27 09:08 by jose