美文网首页
爬取ip地址信息

爬取ip地址信息

作者: 又大又甜的桂圆 | 来源:发表于2019-07-23 11:27 被阅读0次

    通过requests携带登录信息,爬取ip地址

    import json,requests
    
    login_session = requests.Session()
    headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'}
    
    def login():
        url = 'http://11.59.16.211:8080/login/login'
        
        data = {'username':'lhsh','userpass':'57f1af7cf875fa82eb81681bda56712a','pass_token':'1c4ee1439a892188ca9309d112c36c4f'}
        login_session.post(url=url, data=data,json=True,headers=headers)
    
    def home():
        url2 = 'http://11.59.16.211:8080/security/index/list?gid=0&limit=200'
        response = login_session.get(url2,headers = headers)
        r = response.content.decode('unicode_escape')
        finall = json.loads(s = r)
    
    
    
    if __name__ == "__main__":
        login()
        home()
    
    

    相关文章

      网友评论

          本文标题:爬取ip地址信息

          本文链接:https://www.haomeiwen.com/subject/bclolctx.html