jared hace 3 años
padre
commit
f3b7de1f89
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      swire_shop_item_list.py

+ 2 - 2
swire_shop_item_list.py

@@ -89,7 +89,7 @@ def keyin_keyword(driver, keyword):
 
 def get_next_job(db):
     result={}
-    cursor = db.query('select distinct(kw),num+1 as num from progress_list2 where num < 367 order by num asc limit 1')
+    cursor = db.query('select distinct(kw),num+1 as num from progress_list2 where num < 367 order by rand() limit 1')
     for c in cursor:
         result['kw']=c['kw']
         result['num']=c['num']
@@ -155,7 +155,7 @@ def save_js_to_db(jsobj,num,keyword):
 
 def process_web_request(driver,area_num,keyword):
     query = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, '//button[@vet="19128"]')))
-    time.sleep(14)
+    time.sleep(8)
 
     print("ppppppppp&**********************")
     for request in driver.requests: