|
@@ -139,6 +139,7 @@ def selenium_jared_click():
|
|
|
print('搜尋結果數量',numresults)
|
|
|
if numresults<=0:
|
|
|
print(elmts)
|
|
|
+ cnt=1
|
|
|
for elmt in elmts:
|
|
|
href=elmt.get_attribute('href')
|
|
|
txt=elmt.text
|
|
@@ -153,9 +154,13 @@ def selenium_jared_click():
|
|
|
webdriver.ActionChains(driver).move_to_element(elmt).click().perform()
|
|
|
print(domain)
|
|
|
print(href)
|
|
|
+ table=db['seo_jobs_ranking']
|
|
|
+ table.insert({'ranking':cnt,'kw':kw,'results':numresults,'url':href,'title':txt})
|
|
|
+
|
|
|
driver.quit()
|
|
|
return txt
|
|
|
break
|
|
|
+ cnt+=1
|
|
|
return '{empty}'
|
|
|
# time.sleep(5)
|
|
|
|