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/10/17 11:02] jose
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 302: Line 316:
 o.click() o.click()
 </code> </code>
 +
 +======= Padres e hijos =======
 +
 +
 +
informatica/linux/selenium.txt · Last modified: 2022/12/27 09:08 by jose