Save a Web Page with Python Selenium -
i using selenium webdriver python 2.7:
start browser:
browser = webdriver.firefox()
.go url:
browser.get('http://www.google.com')
.
at point, how can send 'save page as' command browser?
note: not web-page source interested in. save page using actual 'save page as' firefox command, yields different results saving web-page source.
unfortunately can't selenium. can use page_source html get.
selenium unfortunately can't interact dialog given when save as.
you can following dialog need autoit finish off
from selenium.webdriver.common.action_chains import actionchains saveas = actionchains(driver).key_down(keys.control)\ .send_keys('s').key_up(keys.control) saveas.perform()
Comments
Post a Comment