Преглед изворни кода

executable path deprecated

zooeytsai пре 2 година
родитељ
комит
04aba8542c
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      INNNews/general_clickbot.py

+ 3 - 3
INNNews/general_clickbot.py

@@ -71,7 +71,7 @@ def process_query(qs):
 def run_once(q):
     global driver
     result=[]
-    # s = Service('/root/driver/chromedriver')
+    s = Service('/root/driver/chromedriver')
     options = webdriver.ChromeOptions()
     options.add_argument('--headless')
     options.add_argument('--remote-debugging-port=9222')
@@ -80,12 +80,12 @@ def run_once(q):
     options.add_argument("--incognito")
 
     driver = webdriver.Chrome(
-    options=options,executable_path='/root/driver/chromedriver')
+    options=options,service=s)
 
     driver.delete_all_cookies()
     driver.set_window_size(1400,1000)
 
-    print(q)
+    print('到此')
     process_query(q)
     time.sleep(3)
     driver.quit()