Last active
October 16, 2020 05:08
-
-
Save orlea/6ec16caa7fd7d46c95e7201310b4e43e to your computer and use it in GitHub Desktop.
WatchGuard Firebox config downloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import json | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
options = Options() | |
options.add_argument('--headless') | |
desired_capabilities = DesiredCapabilities.CHROME.copy() | |
desired_capabilities['acceptInsecureCerts'] = True | |
driver = webdriver.Chrome(chrome_options=options, desired_capabilities=desired_capabilities) | |
driver.get("https://10.0.0.1:8080/auth/login?from_page=/") | |
driver.set_window_size(1080, 800) | |
driver.find_element(By.ID, "username").send_keys("status") | |
driver.find_element(By.ID, "password").send_keys("readonly") | |
driver.find_element(By.ID, "password").send_keys(Keys.ENTER) | |
driver.find_element(By.XPATH, "//*[@id='webui_nav_list']/li[8]").click() | |
time.sleep(2) | |
driver.find_element(By.LINK_TEXT, "構成ファイル").click() | |
time.sleep(5) | |
driver.find_element(By.ID, "download_config").click() | |
time.sleep(3) | |
driver.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
only japanese environment.
I have confirmed that it works on Ubuntu 20.04.
environment