|
@@ -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)
|
|
|
|