Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

headless-selenium-for-win using Python

I found a headless IE from this github project headless-selenium-for-win

Which has the following files

desktop_utils.exe
headless_ie_selenium.exe

I extracted these files to C:\Selenium\headless-selenium

I used Selenium Python library to control IE(GUI) using IEDriverServer.exe which works well but when I use headless_ie_selenium.exe my script just went into endless execution and prints nothing.

Here is my Python Code

from selenium import webdriver
from selenium.webdriver.common.keys import Keys


#driver = webdriver.Ie(r"C:/Selenium/IEDriverServer.exe")
driver = webdriver.Ie(r"C:/Selenium/headless-selenium/headless_ie_selenium.exe")
driver.get("www.google.com")
googleSearch = driver.find_element_by_name("q")
googleSearch.send_keys("Selenium")
googleSearch.send_keys(Keys.ENTER)

import time
time.sleep(4)

print driver.title
like image 860
Balakrishnan Avatar asked Jul 26 '26 14:07

Balakrishnan


1 Answers

I added the path of IEDriverServer.exe to System Variable path and after restarting my system the everything works fine.

like image 142
Balakrishnan Avatar answered Jul 29 '26 05:07

Balakrishnan