【问题标题】:How to open a downloaded excel file in selenium如何在硒中打开下载的excel文件
【发布时间】:2021-05-05 21:39:10
【问题描述】:

谁能帮我解决以下问题?

单击下载文件时,它会成功下载,但我无法打开文件。

谁能建议我如何打开 Mac 下载文件

【问题讨论】:

标签: selenium automation


【解决方案1】:

您没有发布任何示例代码,但无论如何,请查看这个通用示例。

import requests
url = "https://www.nordpoolgroup.com/Market-data1/Power-system-data/Production1/Wind-Power-Prognosis/DK/Hourly/?view=table"

r = requests.post(url)   #POST Request
with open('data_123.xls', 'wb') as f:
    f.write(r.content)

# file goes here, by default, if WD is not changed to somewhere else:
# C:\Users\your_path_here\

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多