Created
June 22, 2022 13:27
-
-
Save 0xFelix/8a461d72c24fc34390c2d1400b35c99b to your computer and use it in GitHub Desktop.
Get Windows 10 English ISO download url
This file contains hidden or 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
#!/usr/bin/python | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.select import Select | |
options = Options() | |
options.headless = True | |
driver = webdriver.Chrome(options=options) | |
driver.implicitly_wait(10) | |
try: | |
driver.get("https://www.microsoft.com/en-us/software-download/windows10ISO") | |
select_object = Select(driver.find_element(By.ID, "product-edition")) | |
select_object.select_by_index(1) | |
button_element = driver.find_element(By.ID, "submit-product-edition") | |
button_element.click() | |
select_object = Select(driver.find_element(By.ID, "product-languages")) | |
select_object.select_by_visible_text("English (United States)") | |
button_element = driver.find_element(By.ID, "submit-sku") | |
button_element.click() | |
download_link = driver.find_element(By.LINK_TEXT, "64-bit Download") | |
print(download_link.get_attribute("href")) | |
except: | |
pass | |
driver.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment