jared 3 months ago
parent
commit
b1ae432353
1 changed files with 5 additions and 0 deletions
  1. 5 0
      deployment/selwire_click.py

+ 5 - 0
deployment/selwire_click.py

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