Your Name 3 rokov pred
rodič
commit
b973c1b33a
1 zmenil súbory, kde vykonal 10 pridanie a 9 odobranie
  1. 10 9
      hhh/SEO/hhh_phantom.py

+ 10 - 9
hhh/SEO/hhh_phantom.py

@@ -19,23 +19,24 @@ for l in lines:
 fr.close()
 
 #lst=['13781','3649','2116']
-for i in range(9999):
+#for i in range(9999):
+if True:
     options = webdriver.ChromeOptions()
     options.add_argument('--headless')
     options.add_argument('--disable-gpu')  # Last I checked this was necessary.
-
+    options.add_argument('--incognito')
     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")
-    driver.get(l)
-    print(driver.current_url)
-    driver.implicitly_wait (6)
-    time.sleep(6)
-    driver.save_screenshot('c:/tmp/test.png')
+    for i in range(3):
+        l=random.choice(lst)
+    #    driver.get("https://www.hhh.com.tw/cases/detail/"+l+"/index.php")
+        driver.get(l)
+        print(driver.current_url)
+#        driver.implicitly_wait (2)
+        time.sleep(3)
     driver.quit()