是否可以在 python 中使用 Selenium 来获取 chrome 中媒体文件的卷曲?

Is it possible to use Selenium in python to get the curl of a media file in chrome?

在Chrome检查器中,有获取媒体文件cURL的功能。是否可以使用 python 在 Selenium 中自动执行相同的操作?谢谢!

通过find_element*找到图片元素找到图片的URL,然后用get_attribute

得到"href"属性

可以通过 driver.get_cookies()

检索 cookie

我认为 headers 你必须自己构建

最后你必须将它们放在一个 cURL 请求中