from selenium import webdriver import time import random lst=['13781','3649','2116'] for i in range(9999): options = webdriver.ChromeOptions() options.add_argument('--headless') options.add_argument('--disable-gpu') # Last I checked this was necessary. driver = webdriver.Chrome( desired_capabilities=options.to_capabilities()) driver.set_window_size(1400,1000) l=random.choice(lst) driver.get("https://www.hhh.com.tw/cases/detail/"+l+"/index.php") print(driver.current_url) driver.implicitly_wait (6) time.sleep(6) driver.save_screenshot('c:/tmp/test.png') driver.quit()