|
@@ -131,6 +131,7 @@ def get_next_job(db,repeat=False,repkw=None,repnum=None):
|
|
|
result['num']=repnum
|
|
|
|
|
|
if 'REP' in repkw:
|
|
|
+
|
|
|
# cursor = db.query('select lat_txt,lon_txt,keyword,num from swire_store_list order by rand() limit 1')
|
|
|
cursor = db.query('select lat_txt,lon_txt,keyword,num from swire_store_list where num="'+str(repnum)+'" limit 1')
|
|
|
|
|
@@ -323,7 +324,7 @@ def main():
|
|
|
print('drvier start...')
|
|
|
driver = brower_start(port)
|
|
|
|
|
|
-
|
|
|
+ area_num=None
|
|
|
while True:
|
|
|
try:
|
|
|
if len(sys.argv) > 3 :
|
|
@@ -339,6 +340,14 @@ def main():
|
|
|
area_num=job['num']
|
|
|
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(repnum)+'" ')
|
|
|
+ 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)
|
|
|
# url='https://www.google.com/maps/search/'+safe_string+'/@24.7962279,121.0449762,15z/data=!3m1!4b1?hl=zh-TW'
|
|
|
# print(url)
|
|
@@ -366,6 +375,13 @@ def main():
|
|
|
if failcnt>=15:
|
|
|
sys.exit()
|
|
|
pass
|
|
|
+ aft_cnt=0
|
|
|
+ cursor = db.query('select count(*) as cnt from swire_store_list where num="'+str(repnum)+'" ')
|
|
|
+ for c in cursor:
|
|
|
+ aft_cnt=c['cnt']
|
|
|
+ break
|
|
|
+ db['conv_log'].insert({'num':area_num,'prev':prev_cnt,'next':aft_cnt,'dt':datetime.now()})
|
|
|
+
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|