Your Name 3 rokov pred
rodič
commit
97921ec61f
1 zmenil súbory, kde vykonal 22 pridanie a 0 odobranie
  1. 22 0
      hhh/SEO/hhh_phantom.py

+ 22 - 0
hhh/SEO/hhh_phantom.py

@@ -0,0 +1,22 @@
+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()
+
+