|
@@ -382,6 +382,7 @@ def main():
|
|
|
driver = brower_start(port)
|
|
|
|
|
|
area_num=None
|
|
|
+ repeating=False
|
|
|
while True:
|
|
|
try:
|
|
|
if len(sys.argv) > 4 :
|
|
@@ -390,6 +391,7 @@ def main():
|
|
|
if 'SCAN' in repkw:
|
|
|
job=scan_job(db,repnum)
|
|
|
else:
|
|
|
+ repeating=True
|
|
|
job=get_next_job(db,repeat=True,repkw=repkw,repnum=repnum)
|
|
|
else:
|
|
|
job=get_next_job(db, repkw=globalkw)
|
|
@@ -401,11 +403,11 @@ def main():
|
|
|
safe_string = urllib.parse.quote_plus(keyword)
|
|
|
url = 'https://www.google.com.tw/maps/@{},{},18z?hl=zh-TW'.format(latitude, longitude)
|
|
|
|
|
|
- prev_cnt=0
|
|
|
- cursor = db.query('select count(*) as cnt from swire_store_list where num="'+str(area_num)+'" ')
|
|
|
- for c in cursor:
|
|
|
- prev_cnt=c['cnt']
|
|
|
- break
|
|
|
+# prev_cnt=0
|
|
|
+# cursor = db.query('select count(*) as cnt from swire_store_list where num="'+str(area_num)+'" ')
|
|
|
+# for c in cursor:
|
|
|
+# prev_cnt=c['cnt']
|
|
|
+# break
|
|
|
|
|
|
|
|
|
# url = 'https://www.google.com/maps/search/'+safe_string+'/@{},{},16z/data=!3m1!4b1'.format(latitude, longitude)
|
|
@@ -426,6 +428,8 @@ def main():
|
|
|
# driver.implicitly_wait(30)
|
|
|
ActionChains(driver).move_to_element(element).click(element).perform()
|
|
|
process_web_request(db,driver,area_num,keyword)
|
|
|
+ if repeating:
|
|
|
+ break
|
|
|
pagecnt+=1
|
|
|
if pagecnt>=5:
|
|
|
break
|