Fetch a file from a local url with Python requests?

后端 未结 6 1243
误落风尘
误落风尘 2020-12-02 14:29

I am using Python\'s requests library in one method of my application. The body of the method looks like this:

def handle_remote_file(url, **kwargs):
    res         


        
6条回答
  •  爱一瞬间的悲伤
    2020-12-02 15:04

    The easiest way seems using requests-file. https://github.com/dashea/requests-file (available through PyPI too)

    "Requests-File is a transport adapter for use with the Requests Python library to allow local filesystem access via file:// URLs."

    This in combination with requests-html is pure magic :)

提交回复
热议问题