|
@@ -43,7 +43,8 @@ def addSpiderLink():
|
|
|
task = mysql_con.get_values(task_sql)
|
|
|
spider_links = eval(task[0]['spider_link'])
|
|
|
spider_links.append(spider_link)
|
|
|
- u_sql = f'update crawler_task set spider_link="{spider_links}",update_time={now_time} where task_id={task_id}'
|
|
|
+ str_spider_links = str(spider_links)
|
|
|
+ u_sql = f'update crawler_task set spider_link={str_spider_links},update_time={now_time} where task_id={task_id}'
|
|
|
mysql_con.update_values(u_sql)
|
|
|
return jsonify({'code': 200, 'message': '抓取名单增加成功', 'del_link': spider_link})
|
|
|
else:
|
|
@@ -53,7 +54,9 @@ def addSpiderLink():
|
|
|
|
|
|
spider_links = eval(result[0]['spider_link'])
|
|
|
spider_links.append(spider_link)
|
|
|
- u_sql = f'update crawler_task set spider_link="{spider_links},update_time={now_time} " where task_id={task_id}'
|
|
|
+ str_spider_links = str(spider_links)
|
|
|
+
|
|
|
+ u_sql = f'update crawler_task set spider_link={str_spider_links},update_time={now_time} " where task_id={task_id}'
|
|
|
mysql_con.update_values(u_sql)
|
|
|
|
|
|
return jsonify({'code': 200, 'message': '抓取名单增加成功', 'add_link': success_list})
|