Honestly, I just want to save a web page as a text file. So what I do:
fp=webdriver.FirefoxProfile()
browser = webdriver.Firefox(firefox_profile=fp)
browser.get('http://www.google.com')
saveas = ActionChains(browser).key_down(Keys.CONTROL)\
.send_keys('s').key_up(Keys.CONTROL)
saveas.perform()
But it goes directly to Save As window of Firefox and all I need is to press Enter button to save the page. How can I do this?
I don't want use another library for pressing keys (although, if there is no alternative I may consider it). Also, if there is an easier way to save a page as a text file with Selenium I would adopt it.