playwright下载文件如何不被删除

        with page.expect_download() as download_info:

            # Perform the action that initiates download
            # page.wait_for_timeout(500)
            page.locator(element_locator).click()

            # page.wait_for_selector(down)
            page.goto(s)

            down = '触发下载的元素'  # 具体替换一下
            page.locator(down).click()
            # print(True)
        download = download_info.value

        # Wait for the download process to complete and save the downloaded file somewhere
        download.save_as(r"D:\可删除\验证下载\\" + download.suggested_filename)  # “”内替换成本地地址
        print(f"-已下载>>", download.suggested_filename)

相关推荐

  1. playwright下载文件如何删除

    2024-07-12 02:38:01       18 阅读
  2. 如何删除github中已经追踪的文件

    2024-07-12 02:38:01       40 阅读
  3. 如何删除.gitignore文件中指定的所有忽略的文件

    2024-07-12 02:38:01       29 阅读
  4. 文件文件夹占用无法删除

    2024-07-12 02:38:01       30 阅读
  5. Playwright

    2024-07-12 02:38:01       34 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 02:38:01       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 02:38:01       71 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 02:38:01       58 阅读
  4. Python语言-面向对象

    2024-07-12 02:38:01       69 阅读

热门阅读

  1. c#中的超时终止

    2024-07-12 02:38:01       18 阅读
  2. 归并排序算法Python实现

    2024-07-12 02:38:01       22 阅读
  3. 07-7.4.2 B+树

    2024-07-12 02:38:01       19 阅读
  4. 生信技能52 - VCF文件hg38与hg19坐标相互转换

    2024-07-12 02:38:01       20 阅读
  5. 技术总结(1)——方向与成长思考

    2024-07-12 02:38:01       23 阅读
  6. 《穿透财报:读懂财报中的逻辑与陷阱》

    2024-07-12 02:38:01       21 阅读
  7. Spring——自动装配Bean

    2024-07-12 02:38:01       21 阅读
  8. 前端高頻面試題(一)

    2024-07-12 02:38:01       22 阅读
  9. SpringBoot常见注解

    2024-07-12 02:38:01       19 阅读
  10. linux lvm使用

    2024-07-12 02:38:01       20 阅读
  11. ETag:Springboot接口如何添加Tag

    2024-07-12 02:38:01       22 阅读
  12. 3. 排序算法代码-python

    2024-07-12 02:38:01       23 阅读
  13. android 图片轮播

    2024-07-12 02:38:01       19 阅读
  14. ubuntu 检查硬盘的通电时长、健康度

    2024-07-12 02:38:01       24 阅读
  15. SQL约束

    2024-07-12 02:38:01       25 阅读