|
@@ -591,7 +591,7 @@ def main():
|
|
|
port = 2
|
|
|
|
|
|
for i in range(10):
|
|
|
- result = db2.query('select * from swire_store_list where check_ is null ORDER BY RAND() limit 500')
|
|
|
+ result = db2.query('select * from swire_store_list where check_ is null and fid not in (select distinct fid from error_list2) ORDER BY RAND() limit 500')
|
|
|
url_pd = pd.DataFrame([dict(i) for i in result])
|
|
|
url_pd['item_url'] = url_pd['fid'].apply(lambda x: 'https://www.google.com.tw/maps/@24.1753633,120.6747136,15z/data=!4m5!3m4!1s{}!8m2!3d24.1760271!4d120.6705323'.format(x))
|
|
|
|
|
@@ -668,7 +668,7 @@ def main():
|
|
|
table2.upsert({'place_id':row['place_id'],'check_':1},['place_id'])
|
|
|
except Exception as e:
|
|
|
table3 = db2['error_list2']
|
|
|
- table3.insert({'num':row['name'],'keyword':row['keyword'],'item_url':row['item_url'],'crawler_date':datetime.today().strftime("%Y/%m/%d %H:%M")})
|
|
|
+ table3.insert({'fid':row['fid'],'num':row['name'],'keyword':row['keyword'],'item_url':row['item_url'],'crawler_date':datetime.today().strftime("%Y/%m/%d %H:%M")})
|
|
|
print(e)
|
|
|
# error_table_col = ['name', 'keyword', 'item_url', 'crawler_date']
|
|
|
# db = DA.mysql_connect(MYSQL_CONFIG, DB_NAME)
|