0

I am trying to save html file using webriver

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


driver = webdriver.Ie("D:\\IEDriver\\IEDriverServer.exe")
driver.get("https://www.google.com/")

actions = ActionChains(driver)
actions.send_keys(Keys.LEFT_CONTROL + 's')
actions.perform()

"Save Webpage" window dialog popup so could you please advise how can I enter a file name and choose format (mth) and click save.

I know that it is possible to save html using urllib2 or import os, sys from win32com but I need do it in this way. Actually chilkat.GetAndSaveMHT does not save in proper format.

Ddos_dev
  • 13
  • 1
  • 3

1 Answers1

0

You cannot enter a file name and choose a format using Selenium alone, because it cannot interact with the Save As system dialogue. You can follow this instructions to avoid the dialogue, or rely on some library - pywinauto and pywin32 for instance.

Rafael Oliveira
  • 277
  • 1
  • 16