python类cElementTree()的实例源码

dav.py 文件源码 项目:davscan 作者: Graph-X 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def propfind(self,s,u, headers=None):
            print("[*] Sending PROPFIND request...")
        headers = s.headers
        if 'Depth' not in headers.keys():
            headers.update({'Depth': 'infinity'})
        r = s.request('PROPFIND', u, headers=headers)
        if r.status_code == 301:
        url = urlparse(r.headers['location'])
        return self.propfind(s,url.path)
            if r.status_code == 200 or r.status_code == 207:
                print("[*] Listing received.  Parsing XML. Depending on the size this might take a minute...")
                soup = bs(r.text, 'xml')
                return [r.status_code, soup]
            if r.status_code == 403:
                #trying again with depth 1
                headers.update({'Depth': '1'})
                print("[!] 403 Forbidden status code returned. Adjusting Depth header...")
                return self.propfind(s,u,headers)


问题


面经


文章

微信
公众号

扫码关注公众号