123456789101112131415161718192021222324 |
- 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.
- options.add_argument('--no-sandbox')
- options.add_argument('--disable-dev-shm-usage')
- 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()
|