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 revision Previous revision
informatica:linux:selenium [2019/09/23 21:29]
jose
informatica:linux:selenium [2019/09/24 09:20] (current)
javi [Python firefox headless local]
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() 
-        ​d ​= 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>​
  
informatica/linux/selenium.txt · Last modified: 2019/09/24 09:20 by javi