|
|
@@ -452,8 +452,13 @@ async def run(playwright):
|
|
|
# 确保Chrome已关闭
|
|
|
close_chrome()
|
|
|
|
|
|
- # 使用用户实际的Chrome配置,配置查询chrome://version
|
|
|
- user_data_dir = r'C:/Users/zhens/AppData/Local/Google/Chrome/User Data'
|
|
|
+ # 使用用户实际的Chrome配置
|
|
|
+ # 请按照以下步骤找到正确的配置文件路径:
|
|
|
+ # 1. 打开 Chrome 浏览器
|
|
|
+ # 2. 在地址栏输入 chrome://version
|
|
|
+ # 3. 查看"个人资料路径"这一行
|
|
|
+ # 4. 将路径复制到这里
|
|
|
+ user_data_dir = r'C:\Users\zhens\AppData\Local\Google\Chrome\User Data\Default' # 请替换为你的实际配置文件路径
|
|
|
|
|
|
def text_to_div_html(text):
|
|
|
"""将多行文本转换为<div>...</div>格式的HTML"""
|
|
|
@@ -517,7 +522,7 @@ async def run(playwright):
|
|
|
# 'div.question:has-text("今日工作总结") .maileditor-editorview[contenteditable="true"]'
|
|
|
# 这是一个复杂的 CSS 选择器,意思如下:
|
|
|
# div.question:匹配类名为 question 的 div 元素。
|
|
|
- # : has-text("今日工作总结"):这个是 Playwright 扩展的选择器语法,表示该 div.question 元素 包含文本“今日工作总结”。
|
|
|
+ # : has-text("今日工作总结"):这个是 Playwright 扩展的选择器语法,表示该 div.question 元素 包含文本"今日工作总结"。
|
|
|
# .maileditor-editorview[contenteditable = "true"]:在该 div 之下,继续查找一个类名为 maileditor-editorview 且有属性 contenteditable = "true" 的元素。
|
|
|
# .click()
|
|
|
# 表示对找到的这个元素执行点击操作。
|