Jason 1 سال پیش
والد
کامیت
bf556f1058
2فایلهای تغییر یافته به همراه23 افزوده شده و 2 حذف شده
  1. 19 2
      website_clickjobs/type-V/_execute.py
  2. 4 0
      website_clickjobs/type-V/c2.py

+ 19 - 2
website_clickjobs/type-V/_execute.py

@@ -11,6 +11,7 @@ from PIL import Image
 import dataset
 import dataset
 from datetime import datetime
 from datetime import datetime
 from random import randint, choice
 from random import randint, choice
+import json
 
 
 #from setting import rua
 #from setting import rua
 
 
@@ -31,6 +32,23 @@ def restart_browser():
 
 
 resultdict={'搜尋詞':[],'網域':[],'結果標題':[],'結果網址':[],'結果名次':[]}
 resultdict={'搜尋詞':[],'網域':[],'結果標題':[],'結果網址':[],'結果名次':[]}
 
 
+def pickterm(client):
+    ds=db.query('select json from seo.seo_jobs where cust="' + client + '" order by rand() limit 1')
+    #TAG ABOVE AND UNTAG BELOW FOR DEBUG
+    #ds=hhhdb.query('select * from seo.seo_articles where cust=')
+    
+    for c in ds:
+        js=json.loads(c['json'])
+        prefix=js['prefix']
+        postfix=js['postfix']
+        domain=js['domain'][0]
+        positive=js['positive']
+        rnd=js['rnd']
+    kw1 = choice(positive)
+    kw2 = choice(rnd)
+    kw = prefix + " " + kw1 + " " + kw2
+    return kw
+
 def process_one(term, tgt, n, sr, se):
 def process_one(term, tgt, n, sr, se):
     try:
     try:
         print(term)
         print(term)
@@ -105,11 +123,10 @@ def process_one(term, tgt, n, sr, se):
                 table=db['general_log']
                 table=db['general_log']
             
             
             table.insert({'kw':term,'results':count,'url':selection[1],'ranking':selection[2],'title':selection[3],'dt':time_stamp,'type':'vi'})
             table.insert({'kw':term,'results':count,'url':selection[1],'ranking':selection[2],'title':selection[3],'dt':time_stamp,'type':'vi'})
-            time.sleep(30)
+            time.sleep(randint(20,40)) #adjustable
         
         
         driver.quit()
         driver.quit()
         print('completed')
         print('completed')
-        time.sleep(randint(20,40)) #adjustable
     except:
     except:
         traceback.print_exc()
         traceback.print_exc()
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 4 - 0
website_clickjobs/type-V/c2.py


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است