|
@@ -0,0 +1,50 @@
|
|
|
+import gsearch_general
|
|
|
+import sys
|
|
|
+import dataset
|
|
|
+import datetime
|
|
|
+
|
|
|
+db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/seo?charset=utf8mb4')
|
|
|
+table=db['term_gsearch']
|
|
|
+
|
|
|
+
|
|
|
+driver=gsearch_general.restart_browser()
|
|
|
+#idx=gsearch_general.process_query(driver,'團購 email 牛',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'site:facebook.com pages inurl:about 其他聯絡資訊 購',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mailto 批發',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mailto 蛋捲',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 肉乾',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 寵物',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 雞精',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 設計',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 民宿',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 面膜',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 杏仁',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 戶外',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 嬰兒',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 燈泡',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 焦糖',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 芝麻',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 網購',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 膠囊',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 實業',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 工作室',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 企業社',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 電商',number_results=100,language_code='zh-TW')
|
|
|
+#idx=gsearch_general.process_query(driver,'聯絡我們 mail 社會企業',number_results=100,language_code='zh-TW')
|
|
|
+idx=gsearch_general.process_query(driver,'聯絡我們 mail 商城',number_results=100,language_code='zh-TW')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+print(idx)
|
|
|
+for x in idx:
|
|
|
+ x['dt']=datetime.datetime.now()
|
|
|
+ table.insert(x)
|
|
|
+
|
|
|
+if idx==None:
|
|
|
+ print(driver.page_source)
|
|
|
+ if '我們的系統偵測到您的電腦網路送出的流量有異常情況' in driver.page_source:
|
|
|
+ print('baned.....')
|
|
|
+ sys.exit()
|