zoukankan      html  css  js  c++  java
  • 爬取人人网

    from urllib import request
    
    #(1)
    base_url = "http://www.renren.com/310303067/profile"
    
    headers = {
        "cookie":"anonymid=jcfxyb8b3a1gal; _r01_=1; ln_uact=liulidong@tju.edu.cn; ln_hurl=http://hdn.xnimg.cn/photos/hdn421/20141126/1635/h_main_eEoA_e12f0004d761195a.jpg; springskin=set; depovince=GW; JSESSIONID=abcXD-AbwWu8nfxj200hw; ick_login=4b080c0e-f388-4f36-afd3-914916e6ed2f; jebe_key=1c9b8522-46e9-48f9-84a5-94d8acd62f26%7C04d40984875da2c7f482f8241260f1b1%7C1519272342852%7C1%7C1520230955608; first_login_flag=1; ch_id=10016; wp_fold=0; jebecookies=23004b2a-d7ba-420b-ada5-9877c22c0376|||||; _de=3B58DDA08757FF2E8CA2FB2FE86AFE68D2ACF5E1A777358B; p=cc37eed766d2e97b762b7a60c18bb3d07; t=fa0c57f64f203e4bd313cfb4674e74617; societyguester=fa0c57f64f203e4bd313cfb4674e74617; id=310303067; xnsid=b2196bb; loginfrom=syshome"
    }
    
    #(2)
    req = request.Request(base_url,headers=headers)
    response = request.urlopen(req)
    
    # (3)
    html = response.read()
    
    # (4)
    html = html.decode("utf-8")
    
    #(5)
    print(html)
  • 相关阅读:
    type() & dir()

    手机操作API
    APP模拟手势高级操作
    APP元素事件操作API
    APP元素信息操作API
    APP元素定位操作
    手机控件查看工具uiautomatorviewer
    App基础操作API
    Appium入门
  • 原文地址:https://www.cnblogs.com/zhangboblogs/p/8542112.html
Copyright © 2011-2022 走看看