Jason %!s(int64=2) %!d(string=hai) anos
pai
achega
016c5b96bf
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      website_clickjobs/n2nart/_clickjob.py

+ 4 - 2
website_clickjobs/n2nart/_clickjob.py

@@ -94,8 +94,9 @@ def process_query(urllist, query, client):
             print(e[0].text)
             print("Rank: " + str(e[1]))
             db['sns_log'].insert({"kw": query, "ranking": e[1], "url": href, "dt": dt.now(), "client": client, "title": e[0].text, "results": n})'''
-            
-        el = random.choice(clickcand)[0]
+
+        e = random.choice(clickcand)  
+        el = e[0]
         domain_in_link += 1
         print('clicked....')
         href = el.get_attribute('href')
@@ -104,6 +105,7 @@ def process_query(urllist, query, client):
         
         webdriver.ActionChains(driver).move_to_element(el).perform()
         webdriver.ActionChains(driver).move_to_element(el).click().perform()
+        db['sns_log'].insert({"kw": query, "ranking": e[1], "url": href, "dt": dt.now(), "client": client, "title": el.text, "results": n})
         duration = random.randint(40,60)
         time.sleep(duration)