|
@@ -12,6 +12,7 @@ from playwright.async_api import async_playwright
|
|
|
from applications import check_account, Mysql
|
|
|
from applications.config import platform_map
|
|
|
from applications.functions import navigate
|
|
|
+from feishu.feishu import Feishu
|
|
|
|
|
|
platform_name = None
|
|
|
data_frame = []
|
|
@@ -49,10 +50,10 @@ async def handle_download(download):
|
|
|
w = {temp: data_line[index] for index, temp in enumerate(title_row)}
|
|
|
print(platform_name, "\t", task_name, "\t", task_index)
|
|
|
print(json.dumps(w, ensure_ascii=False, indent=4))
|
|
|
- # while len(temp) < 29:
|
|
|
- # temp.append("NULL")
|
|
|
- # Mysql().insert_line(data=temp)
|
|
|
- # data_frame.append(temp)
|
|
|
+ while len(temp) < 29:
|
|
|
+ temp.append("NULL")
|
|
|
+ Mysql().insert_line(data=temp)
|
|
|
+ data_frame.append(temp)
|
|
|
os.remove(new_file_path)
|
|
|
|
|
|
|
|
@@ -91,17 +92,20 @@ async def run(playwright):
|
|
|
await page.goto("https://wedata.weixin.qq.com/mp2/basic-data/core-data?source=0")
|
|
|
|
|
|
done_dict = {}
|
|
|
+ F = Feishu()
|
|
|
platform_name = '票圈内容精选'
|
|
|
await navigate(page, platform_name)
|
|
|
done_dict[platform_name] = 1
|
|
|
+ F.bot(platform_name)
|
|
|
|
|
|
for platform_name in platform_map.keys():
|
|
|
if done_dict.get(platform_name):
|
|
|
print(f"{platform_name} has already been exported")
|
|
|
else:
|
|
|
await check_account(page, platform_name)
|
|
|
- # await page.wait_until_loaded()
|
|
|
await navigate(page, platform_name)
|
|
|
+ done_dict[platform_name] = 1
|
|
|
+ F.bot(platform_name)
|
|
|
|
|
|
# 关闭浏览器上下文和浏览器
|
|
|
await context.close()
|