|
@@ -139,21 +139,22 @@ def run_once(jsobj):
|
|
txt=elmt.text
|
|
txt=elmt.text
|
|
if len(txt)>10:
|
|
if len(txt)>10:
|
|
if domain is not None:
|
|
if domain is not None:
|
|
- if domain in href:
|
|
|
|
- print('found....')
|
|
|
|
- print('clicked....')
|
|
|
|
- print(href)
|
|
|
|
- print(txt)
|
|
|
|
- print("ranking", idx)
|
|
|
|
- found=True
|
|
|
|
-
|
|
|
|
- webdriver.ActionChains(driver).move_to_element(elmt).perform()
|
|
|
|
- elmt.click()
|
|
|
|
-# webdriver.ActionChains(driver).move_to_element(elmt).click().perform()
|
|
|
|
- table.insert({'ranking':idx,'kw':kw,'results':numresults,'url':href,'title':txt})
|
|
|
|
-
|
|
|
|
- time.sleep(6)
|
|
|
|
- break
|
|
|
|
|
|
+ for d in domain:
|
|
|
|
+ if d in href:
|
|
|
|
+ print('found....')
|
|
|
|
+ print('clicked....')
|
|
|
|
+ print(href)
|
|
|
|
+ print(txt)
|
|
|
|
+ print("ranking", idx)
|
|
|
|
+ found=True
|
|
|
|
+
|
|
|
|
+ webdriver.ActionChains(driver).move_to_element(elmt).perform()
|
|
|
|
+ elmt.click()
|
|
|
|
+ # webdriver.ActionChains(driver).move_to_element(elmt).click().perform()
|
|
|
|
+ table.insert({'ranking':idx,'kw':kw,'results':numresults,'url':href,'title':txt})
|
|
|
|
+
|
|
|
|
+ time.sleep(6)
|
|
|
|
+ return
|
|
else:
|
|
else:
|
|
ex=False
|
|
ex=False
|
|
for ee in exclude:
|
|
for ee in exclude:
|
|
@@ -171,8 +172,8 @@ def run_once(jsobj):
|
|
print(txt_dict[elmt])
|
|
print(txt_dict[elmt])
|
|
|
|
|
|
webdriver.ActionChains(driver).move_to_element(elmt).perform()
|
|
webdriver.ActionChains(driver).move_to_element(elmt).perform()
|
|
- elmt.click()
|
|
|
|
-# webdriver.ActionChains(driver).move_to_element(elmt).click().perform()
|
|
|
|
|
|
+# elmt.click()
|
|
|
|
+ webdriver.ActionChains(driver).move_to_element(elmt).click().perform()
|
|
time.sleep(5)
|
|
time.sleep(5)
|
|
|
|
|
|
if not found:
|
|
if not found:
|
|
@@ -189,17 +190,24 @@ par1=sys.argv[1]
|
|
port=sys.argv[2]
|
|
port=sys.argv[2]
|
|
#kws=['職籃','PLG','高雄','鋼鐵人','內幕','中資','股東','姊夫','中國','老賴','香港','無極','原始股東','外資','董事長','股權結構','高雄人','黑人','陳建州','職籃聯盟','球團','球團高層','香港無極','張憲銘','吳同喬','監察人']
|
|
#kws=['職籃','PLG','高雄','鋼鐵人','內幕','中資','股東','姊夫','中國','老賴','香港','無極','原始股東','外資','董事長','股權結構','高雄人','黑人','陳建州','職籃聯盟','球團','球團高層','香港無極','張憲銘','吳同喬','監察人']
|
|
kws=['金融', '人才', '國際接軌','國際','投資金童','投資','金童','對沖基金','香港','外資','原始股東','職籃','PLG','職籃聯盟','球團','台灣女婿','抹紅','保守','港元','美國','升息','戰爭','通膨','亞洲','亞洲投資金童']
|
|
kws=['金融', '人才', '國際接軌','國際','投資金童','投資','金童','對沖基金','香港','外資','原始股東','職籃','PLG','職籃聯盟','球團','台灣女婿','抹紅','保守','港元','美國','升息','戰爭','通膨','亞洲','亞洲投資金童']
|
|
-positive=['錢濤','亞洲最強對沖基金','亞洲投資金童','年底前投資須保守','對沖基金創始人錢濤','錢濤 升息','錢濤 職籃夢']
|
|
|
|
|
|
+positive=['引新聞','亞洲最強對沖基金','亞洲投資金童','年底前投資須保守','對沖基金創始人錢濤','升息','職籃夢','innews','66474','生活消費 網友熱搜','懷孕','亞洲對沖基金','攤證據','證據','台灣女婿','通膨','喊冤','亞洲投資金童','創始人','年底前','自由財經','美國升息','兼執行官','個人因素','經濟通','LTN','奇摩','金融巨鱷','投資績效','掌門人','亮眼成績','在台生根','孕妻待產','長住台灣','兼首席執行官','無極資本提供','新冠疫情反覆','戰事膠著','華爾街日報','國際接軌','本地券商','台灣金融人才','彭博社','路透社','量化投資團隊','量化投資業務','人工智慧','演算法','大數據分析','解決方案','全球化']
|
|
|
|
+
|
|
|
|
+#positive=['錢濤','亞洲最強對沖基金','亞洲投資金童','年底前投資須保守','對沖基金創始人錢濤','錢濤 升息','錢濤 職籃夢','引新聞 錢濤']
|
|
os.system('docker container restart '+par1)
|
|
os.system('docker container restart '+par1)
|
|
kw=random.choice(kws)
|
|
kw=random.choice(kws)
|
|
#time.sleep(9)
|
|
#time.sleep(9)
|
|
#run_once({'domain':'ettoday.net','kw':'錢濤'})
|
|
#run_once({'domain':'ettoday.net','kw':'錢濤'})
|
|
#run_once({'exclude':['moreptt.com','ptt.cc','tnews.cc','mirrormedia.mg','newtalk.tw','pourquoi.tw','match.net.tw','freshweekly.tw','z-upload.facebook.com','udn.com'],'kw':kw+' 錢濤'})
|
|
#run_once({'exclude':['moreptt.com','ptt.cc','tnews.cc','mirrormedia.mg','newtalk.tw','pourquoi.tw','match.net.tw','freshweekly.tw','z-upload.facebook.com','udn.com'],'kw':kw+' 錢濤'})
|
|
-domains=['yahoo.com','ettoday.net','tvbs.com.tw','sina.com.tw','ltn.com.tw','owlting.com','ctee.com.tw']
|
|
|
|
-domain=random.choice(domains)
|
|
|
|
-p=random.choice(positive)
|
|
|
|
|
|
+domain=['yahoo.com','ettoday.net','tvbs.com.tw','sina.com.tw','ltn.com.tw','owlting.com','ctee.com.tw']
|
|
|
|
+#domain=random.choice(domains)
|
|
|
|
+#p=random.choice(positive)
|
|
#run_once({'domain':domain,'kw':p})
|
|
#run_once({'domain':domain,'kw':p})
|
|
-run_once({'domain':'ettoday.net','kw':p})
|
|
|
|
|
|
+#pairs=[{'domain':'innews.com.tw','kw':'錢濤 引新聞'},{'domain':'innews.com.tw','kw':'innews 錢濤'},{'domain':'innews.com.tw','kw':'錢濤 66474'},{'domain':'innews.com.tw','kw':'錢濤 生活消費 網友熱搜'},{'domain':'yahoo.com','kw':'錢濤 懷孕'},{'domain':'yahoo.com','kw':'亞洲對沖基金 錢濤'},
|
|
|
|
+#{'domain':'ltn.com.tw','kw':'科技人才 錢濤'}]
|
|
|
|
+#p=random.choice(pairs)
|
|
|
|
+
|
|
|
|
+p=random.choice(positive)
|
|
|
|
+run_once({'domain':domain,'kw':p+" 錢濤"})
|
|
|
|
|
|
#run_once({'domain':domain,'kw':kw+' 錢濤'})
|
|
#run_once({'domain':domain,'kw':kw+' 錢濤'})
|
|
|
|
|