• 【千锋Python2205班10.20笔记-day04-接口和常见反爬(一阶段)】


    01-数据接口

    import requests
    
    response = requests.get('https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js')
    for x in response.json()['hero']:
        print(x['name'], x['title'], x['goldPrice'])
    
    • 1
    • 2
    • 3
    • 4
    • 5

    02-英雄皮肤下载

    import requests
    import os
    # https://game.gtimg.cn/images/lol/act/img/js/hero/1.js
    # https://game.gtimg.cn/images/lol/act/img/js/hero/2.js
    
    
    def get_all_hero_id():
        """获取所有英雄的英雄id"""
        response = requests.get('https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js')
        result = response.json()
        hero_id_list = [x['heroId'] for x in result['hero']]
        return hero_id_list
    
    
    def get_one_hero_skins(hero_id):
        """下载一个英雄所有皮肤"""
        url = f'https://game.gtimg.cn/images/lol/act/img/js/hero/{hero_id}.js'
        result = requests.get(url).json()
        for x in result['skins']:
            # 1. 获取每个皮肤的相关信息
            hero_name = x['heroName']
            skin_name = x['name']
            skin_url = x['mainImg']
            if not skin_url:
                skin_url = x['chromaImg']
    
            # 2. 创建英雄名称对应的文件夹
            path = f'files/{hero_name}'
            if not os.path.exists(path):
                # 不存在就创建对应的文件夹
                os.mkdir(path)
    
            # 3. 下载皮肤对应的图片
            img_data = requests.get(skin_url).content
            with open(path+f'/{skin_name}.jpg', 'wb') as f:
                f.write(img_data)
    
        print(f'{hero_name}的皮肤下载完成')
    
    
    if __name__ == '__main__':
        # 1. 获取所有英雄的英雄id
        ids = get_all_hero_id()
    
        # 2.遍历拿到每个英雄的id,拼接对应的皮肤接口地址
        for x in ids:
            get_one_hero_skins(x)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47

    03-requests自动登录

    import requests
    
    headers = {
        'cookie': '_zap=b1124762-828e-435d-b04c-7c59a1786742; _xsrf=774cb199-0e1c-4b28-bb60-8c62b565c8bc; d_c0=AUCYBu3vvBWPTm-arz42Iw6N9McyUzXcK4c=|1666236614; __snaker__id=h9XPzR2HWZU7g32U; gdxidpyhxdE=0E5%2Fpw5xVQk4I8AjL4%5Czi82PtOTmygoSeGwhICxLLVZ7rKD0sGAX%2Fl7ag0qgWvwWbBzp%2Bxs12%2BMMs2IKlxRPe8L8sCamvqfgU1%2B%5CTCuuj%2Fq%2F%2F%2BHyiITWG0KpRs%5Ck6WWJmfc0GBXBxMInMsQ0ccwDz8m4fd%5Ct91fnkea26sfCjcpMjU1K%3A1666237515104; YD00517437729195%3AWM_NI=6f%2BZdRG4pSroFkLgghutDCxnyNtfeQ99uG2rLkD8zzsTok7nLjMSRCCUCwF9R4Fv9q8pTvFCpGD2fshT%2BjV6hSJ70OKqsxHrJR1HLJb6bcxJbjanWbk3byL2QpG%2BcPdNajk%3D; YD00517437729195%3AWM_NIKE=9ca17ae2e6ffcda170e2e6eea6d3439b8fbab8d247b0eb8bb3c85f869b9facc84db2eba0adfb5282a7a282e42af0fea7c3b92af6bae5bbe75a85ecc0b4f16586b58488e664b7ac8ca4fb66bb92bc87e85bfbe7bba8b17a90b58cd9f972b18ca18cb66690b683b4d149818b8d98c53392ec8a97bc7bfcb09c97c549b4998cd3e579ac8ce58bd53eac8d86d8b34589afbd99cb7a8a8effa9cf42a2eaae84fb42a2b6af8fd66aa9edae9acf3a93b089cce25ca892af8bea37e2a3; YD00517437729195%3AWM_TID=NdK2P0cmZUdBQUEFUULUXq9fP1YFijKK; captcha_session_v2=2|1:0|10:1666236622|18:captcha_session_v2|88:Y1VMdHV1MFJCTjMzQzFVYVExUEhLVW8ra1lqbDFVbzhpY1FtT1BJMGErUis0VE5GZmlPTnBHQ2FKVUx1Q09jLw==|e2e3d50d5966c7f04f11bbc9430caefa856fedbe0b81fb941a5601435ce1670c; captcha_ticket_v2=2|1:0|10:1666236651|17:captcha_ticket_v2|704:eyJ2YWxpZGF0ZSI6IkNOMzFfSy1WVy5MS3N0NmZsVzk1T0VLMTdOWU05bTI5anJOZTBFUHJlcG8wWG9ZNEppak5jc2REMFpOTzVsWThSSnFlUTRhZDQ5ZEwxdkJ3Um1XaERlR01PckUtWURkLmlhd3BjVUgwdk5GNld1NzlqY0FSWDUyTldVOEhueW9yTlpHSC5ZOVBfZWxnMDVpMndHaXZrakJWZVQ4ZEU3a1BmVUdHOFM1aHZTQ1hMZWpzQXhLWlYyQm1hUnlGVl93dGd1Li1YOWdmR1c0eXMyTHhvaGJGbjRWNnVGaHlPRy15X3EwcDdTa2YwS3dxZ3lRVENzcjVNSEtDRXgwTEc1RzE1ZWU1TEFkN1lVLXI4WUduRTdNVWhEZFZfQmRfNUJ0b0JoQ2h0Ql8tbDY1Nk9QNlI5VUF2YnVnd0haNHI2UUktR3NsSUdYQ2dJVl9MV1JBZEdCZTY0LktpZ0x3emd2STZQT2RTc2ppc1JEd0hzWXpmRXdzVUhTRlZzb0ZvTEttVHVtTHM0b0IyR2RqUkc3TnBLQ09wd19fajg5aFNUaUR2RFc4Rk96Wi1Md2U3c2QxbGlGV003QmNIbDA0bDlMQ3N0VjR1UHZnNE9QY3JZOG5YQmZ3aDh2SXplczVWVEl2LmpqVEVnSmYwLmZmc1d2NzFVd0ouMDZGaFJWTDJJQlZYMyJ9|8b8701de0198ab00e821f6deeb6ea8598ca444615c1166543fff1ce899f45d76; z_c0=2|1:0|10:1666236667|4:z_c0|92:Mi4xaW5CWUdRQUFBQUFCUUpnRzdlLThGU1lBQUFCZ0FsVk4tdzQtWkFDMUdXVVRpM2xMQkNpT2x6WGwyWWJHbkh5Uk53|2f44557aacbe41f585dcf8586df529133b0eabd958de5974908ca4b500840f96; q_c1=b4bc9487357a4804b8bf100ad46fb07e|1666236667000|1666236667000; NOT_UNREGISTER_WAITING=1; tst=r; SESSIONID=NMIvpzh1H0KgDQHvcVlyotltvV0Py4d5qCNQ3PXRe4T; KLBRSID=53650870f91603bc3193342a80cf198c|1666236826|1666236613',
        'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
    }
    response = requests.get('https://www.zhihu.com/', headers=headers)
    print(response.text)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    04-selenium获取cookie

    from selenium.webdriver import Chrome
    
    • 1

    1.用selenium打开需要获取cookie的网站

    b = Chrome()
    b.get('https://www.taobao.com')
    
    • 1
    • 2

    2.留足够多的时间来人工完成登录

    input('完成登录:')
    
    • 1

    3.让浏览器对应的网页中出现登录成功信息,再获取cookie(获取整个网站所有的cookie)

    cookies = b.get_cookies()
    
    # print(cookies, type(cookies))
    
    • 1
    • 2
    • 3

    4. 将获取到的cookies写入文件

    with open('files/taobao.txt', 'w', encoding='utf-8') as f:
        f.write(str(cookies))
    
    • 1
    • 2

    05-selenium使用cookie

    from selenium.webdriver import Chrome
    
    • 1

    1.打开需要自动登录的网页

    b = Chrome()
    b.get('https://www.taobao.com')
    
    • 1
    • 2

    2.添加cookie值

    with open('files/taobao.txt', encoding='utf-8') as f:
        cookies = eval(f.read())
        for x in cookies:
            b.add_cookie(x)
    
    • 1
    • 2
    • 3
    • 4

    3. 重新打开网页

    b.get('https://www.taobao.com')
    
    • 1

    06-requests使用代理IP

    import requests
    
    headers = {
            'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
        }
    
    # 设置代理IP
    proxies = {
        'https': '175.22.188.25:4524',
    }
    
    response = requests.get('https://movie.douban.com/top250', headers=headers, proxies=proxies)
    
    if response.status_code == 200:
        print(response.text)
    else:
        print('请求失败')
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17

    07-selenium使用代理

    from selenium.webdriver import Chrome, ChromeOptions
    
    • 1

    1. 给浏览器添加配置

    options = ChromeOptions()
    
    • 1

    1)设置代理

    options.add_argument('--proxy-server=http://171.83.191.223:4526')
    
    • 1

    2)关闭图片加载

    options.add_experimental_option("prefs", {"profile.managed_default_content_settings.images": 2})
    
    • 1

    3)取消测试环境

    options.add_experimental_option('excludeSwitches', ['enable-automation'])
    
    b = Chrome(options=options)
    b.get('https://movie.douban.com/top250')
    
    • 1
    • 2
    • 3
    • 4

    08-前程无忧岗位爬虫

    import requests
    from re import findall
    from json import loads
    
    headers = {
        'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
    }
    
    proxies = {
        'https': '122.137.48.218:4524'
    }
    
    url = 'https://search.51job.com/list/000000,000000,0000,00,9,99,java,2,1.html?lang=c&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&ord_field=0&dibiaoid=0&line=&welfare=&u_atoken=540000ca-581a-4002-aa0f-42aedfba6d36&u_asession=01kn7UwIxmYtNszVTAVFzCGxdHP0qhcha0-osvr6eita2YJVTYgshzhQTv11v_wW-pX0KNBwm7Lovlpxjd_P_q4JsKWYrT3W_NKPr8w6oU7K_1z5GupMvpS3-qdJzJEdUlymCvuFU2gNCRIRJqGpb9omBkFo3NEHBv0PZUm6pbxQU&u_asig=05qFfvfDNOQSPq9NIuzj4ViQi8mdNU0nfqkKpbY1NwgFn7IEzf-HWbIdx1PF5izag9Sr4_jabxb30W4ZvB3yc7qrv6vHeKYQ6JhUhmM1Fblfaq7AKpvOAd9zDedY2USM7SW6KPpoDNo4Zd_KsztAAIVcznu7ABWKDx-WZGW4j2y7b9JS7q8ZD7Xtz2Ly-b0kmuyAKRFSVJkkdwVUnyHAIJzbYXEd-kO_Sj5Qq2OkC0QQLEUWQ0Hrqe4W-P1gzc9X5bb4DvBakBj6x1SID70OM96u3h9VXwMyh6PgyDIVSG1W9f_GWun2RGoF0qWZlOBtVzMcP86Dpk-9o5WW2hT6bxqnfLDaWAmdBzT8FTmMacz4pQSRQmGmppZNXPg0hY8XcdmWspDxyAEEo4kbsryBKb9Q&u_aref=diUHZDkF4ZhqqQRmaoboTC71KAg%3D'
    response = requests.get(url, headers=headers, proxies=proxies)
    print(response.text)
    # 1. 从请求结果中提取json数据
    result = findall(r'window.__SEARCH_RESULT__ = (.+?)', response.text)
    print(result)
    
    # 2. 做json解析
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    demo

    doctype html>
    <html lang="zh" data-hairline="true" data-theme="light"><head><meta charSet="utf-8"/><title data-rh="true">知乎 - 有问题,就会有答案title><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="google-site-verification" content="FTeR0c8arOPKh8c5DYh_9uu98_zJbaWw53J-Sch9MTg"/><meta name="description" property="og:description" content="知乎,中文互联网高质量的问答社区和创作者聚集的原创内容平台,于 2011 年 1 月正式上线,以「让人们更好的分享知识、经验和见解,找到自己的解答」为品牌使命。知乎凭借认真、专业、友善的社区氛围、独特的产品机制以及结构化和易获得的优质内容,聚集了中文互联网科技、商业、影视、时尚、文化等领域最具创造力的人群,已成为综合性、全品类、在诸多领域具有关键影响力的知识分享社区和创作者聚集的原创内容平台,建立起了以社区驱动的内容变现商业模式。"/><link data-rh="true" rel="apple-touch-icon" href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-152.a53ae37b.png"/><link data-rh="true" rel="apple-touch-icon" href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-152.a53ae37b.png" sizes="152x152"/><link data-rh="true" rel="apple-touch-icon" href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-120.bbce8f18.png" sizes="120x120"/><link data-rh="true" rel="apple-touch-icon" href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-76.cbade8f9.png" sizes="76x76"/><link data-rh="true" rel="apple-touch-icon" href="https://static.zhihu.com/heifetz/assets/apple-touch-icon-60.8f6c52aa.png" sizes="60x60"/><link crossorigin="" rel="shortcut icon" type="image/x-icon" href="https://static.zhihu.com/heifetz/favicon.ico"/><link crossorigin="" rel="search" type="application/opensearchdescription+xml" href="https://static.zhihu.com/heifetz/search.xml" title="知乎"/><link rel="dns-prefetch" href="//static.zhimg.com"/><link rel="dns-prefetch" href="//pica.zhimg.com"/><link rel="dns-prefetch" href="//pic1.zhimg.com"/><link rel="dns-prefetch" href="//pic2.zhimg.com"/><link rel="dns-prefetch" href="//pic3.zhimg.com"/><link rel="dns-prefetch" href="//pic4.zhimg.com"/><link rel="dns-prefetch" href="//static.zhihu.com"/><style data-emotion-css="1m4merm">.u-safeAreaInset-top{height:constant(safe-area-inset-top) !important;height:env(safe-area-inset-top) !important;}.u-safeAreaInset-bottom{height:constant(safe-area-inset-bottom) !important;height:env(safe-area-inset-bottom) !important;}style><link href="https://static.zhihu.com/heifetz/main.app.216a26f4.4b5c50c05c1dc21ef574.css" crossorigin="" rel="stylesheet"/><link href="https://static.zhihu.com/heifetz/main.sign-page.216a26f4.afb67073a7cc3a1164ec.css" crossorigin="" rel="stylesheet"/><script nonce="5ff82e46-4acd-469d-8d7d-a0c5a7927a06">!function(){"use strict";!function(e,n){var r=[];function t(e){return function(){r.push([e,arguments])}}n.Raven={captureException:t("captureException"),captureMessage:t("captureMessage"),captureBreadcrumb:t("captureBreadcrumb")};var a,o,c,i,s,u="undefined"!=typeof DOMError;function d(e){var n=e instanceof Error||e instanceof ErrorEvent||u&&e instanceof DOMError||e instanceof DOMException;Raven.captureException(n?e:new Error(e.message||e.reason))}n.addEventListener("unhandledrejection",d),n.addEventListener("error",d,!0),a=e.src,o=e,c=function(){r.forEach(function(e){var n;(n=Raven)[e[0]].apply(n,e[1])}),n.removeEventListener("unhandledrejection",d),n.removeEventListener("error",d,!0)},i=document.head||document.getElementsByTagName("head")[0],(s=document.createElement("script")).crossOrigin=o.crossOrigin,s.dataset.sentryConfig=o["data-sentry-config"],s.onload=c,s.src=a,i.appendChild(s)}({"defer":true,"crossOrigin":"anonymous","src":"https://unpkg.zhimg.com/@cfe/sentry-script@1.3.1/dist/init.js","data-sentry-config":"{\"dsn\":\"https://2d8d764432cc4f6fb3bc78ab9528299d@crash2.zhihu.com/1224\",\"sampleRate\":0.1,\"release\":\"79-a70d4e6c\",\"ignoreErrorNames\":[\"NetworkError\",\"SecurityError\"],\"ignoreErrorsPreset\":\"ReactApp\",\"tags\":{\"app_name\":\"heifetz\"}}"},window)}();
    script>head><body><div id="root"><div><style data-emotion-css="uzm3ri">.css-uzm3ri{position:fixed;top:0;right:0;left:0;z-index:101;display:none;height:2px;pointer-events:none;background:#056DE8;-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%);}style><div class="LoadingBar  css-uzm3ri">div><div><span style="position:absolute;top:-10000px;left:-10000px" role="log" aria-live="assertive">span>div><main role="main" class="App-main"><div><div class="SignFlowHomepage"><div class="SignFlowHomepage-content"><img alt="知乎 LOGO" class="SignFlowHomepage-logo" src="https://pic2.zhimg.com/80/v2-f6b1f64a098b891b4ea1e3104b5b71f6_720w.png"/><div class="signQr-container"><div class="signQr-leftContainer"><div class="Qrcode-container smallVersion"><style data-emotion-css="k49mnn">.css-k49mnn{box-sizing:border-box;margin:0;min-width:0;color:#444444;font-size:16px;font-weight:600;line-height:23px;}style><div class="css-k49mnn">打开知乎Appdiv><style data-emotion-css="qj3urb">.css-qj3urb{box-sizing:border-box;margin:0;min-width:0;margin-top:8px;margin-bottom:24px;color:#444444;font-size:14px;line-height:20px;}style><div class="css-qj3urb">在「我的页」左上角打开扫一扫div><div class="Qrcode-content"><div class="Qrcode-img"><style data-emotion-css="79elbk">.css-79elbk{position:relative;}style><div class="BounceLoading  css-79elbk" style="width:42px;height:18px"><style data-emotion-css="cy45qd animation-1alkx44">.css-cy45qd{position:absolute;background-color:#056DE8;border-radius:50%;-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:animation-1alkx44;animation-name:animation-1alkx44;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both;}@-webkit-keyframes animation-1alkx44{0%,100%{-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%);}50%{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}}@keyframes animation-1alkx44{0%,100%{-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%);}50%{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}}style><span class="BounceLoading-child css-cy45qd" style="top:6px;left:0;width:6px;height:6px;animation-duration:0.8s;animation-delay:0s">span><span class="BounceLoading-child css-cy45qd" style="top:6px;left:18px;width:6px;height:6px;animation-duration:0.8s;animation-delay:-0.13333333333333333s">span><span class="BounceLoading-child css-cy45qd" style="top:6px;left:36px;width:6px;height:6px;animation-duration:0.8s;animation-delay:-0.26666666666666666s">span>div>div><div class="Qrcode-guide-message"><style data-emotion-css="x9rxz4">.css-x9rxz4{box-sizing:border-box;margin:0;min-width:0;margin-top:24px;color:#444444;font-size:14px;font-weight:600;line-height:20px;}style><div class="css-x9rxz4">其他扫码方式:微信div>div>div>div><style data-emotion-css="1rjkgne">.css-1rjkgne{box-sizing:border-box;margin:26px 0 22px;}style><style data-emotion-css="ousx6v">.css-ousx6v{box-sizing:border-box;margin:0;min-width:0;font-size:14px;color:#056DE8;height:60px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;box-sizing:border-box;margin:26px 0 22px;}style><div class="css-ousx6v"><style data-emotion-css="vurnku">.css-vurnku{box-sizing:border-box;margin:0;min-width:0;}style><div class="css-vurnku"><style data-emotion-css="sqn8ql">.css-sqn8ql{padding:4px 10px;border:1px solid #EBEBEB;border-radius:29px;font-size:12px;color:#444444;line-height:19px;display:inline-block;}.css-sqn8ql:hover{background:#F6F6F6;}style><style data-emotion-css="1bdtll5">.css-1bdtll5{box-sizing:border-box;margin:0;min-width:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;text-align:center;line-height:inherit;-webkit-text-decoration:none;text-decoration:none;font-size:inherit;padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px;color:white;background-color:#056DE8;border:0;border-radius:4px;font-size:16px;font-weight:600;color:#FFFFFF;background-color:#056DE8;border-radius:4px;background-color:unset;font-weight:inherit;margin-right:8px;padding:4px 10px;border:1px solid #EBEBEB;border-radius:29px;font-size:12px;color:#444444;line-height:19px;display:inline-block;}.css-1bdtll5:hover{background:#F6F6F6;}style><button class="css-1bdtll5">下载知乎Appbutton>div><style data-emotion-css="epvm6">.css-epvm6{white-space:nowrap;}style><style data-emotion-css="16enr5p">.css-16enr5p{box-sizing:border-box;margin:0;min-width:0;white-space:nowrap;}style><div class="css-16enr5p"><style data-emotion-css="1iubajs">.css-1iubajs{box-sizing:border-box;margin:0;min-width:0;color:#175199;margin-right:8px;padding:4px 10px;border:1px solid #EBEBEB;border-radius:29px;font-size:12px;color:#444444;line-height:19px;display:inline-block;}.css-1iubajs:hover{background:#F6F6F6;}style><a href="/org/signup" data-za-detail-view-id="4943" class="css-1iubajs">开通机构号a>div><div class="css-16enr5p"><style data-emotion-css="186oz3i">.css-186oz3i{box-sizing:border-box;margin:0;min-width:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;text-align:center;line-height:inherit;-webkit-text-decoration:none;text-decoration:none;font-size:inherit;padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px;color:white;background-color:#056DE8;border:0;border-radius:4px;font-size:16px;font-weight:600;color:#FFFFFF;background-color:#056DE8;border-radius:4px;background-color:unset;font-weight:inherit;padding:4px 10px;border:1px solid #EBEBEB;border-radius:29px;font-size:12px;color:#444444;line-height:19px;display:inline-block;}.css-186oz3i:hover{background:#F6F6F6;}style><button data-za-detail-view-id="4943" class="css-186oz3i">无障碍模式button>div>div>div><div class="signQr-rightContainer"><style data-emotion-css="b1vbr6">.css-b1vbr6{overflow:hidden;box-shadow:none;}style><style data-emotion-css="16h0l39">.css-16h0l39{box-sizing:border-box;margin:0;min-width:0;padding:0;background-color:#FFFFFF;box-shadow:0 1px 3px rgba(18,18,18,0.1);border-radius:2px;background-color:#FFFFFF;width:400px;overflow:hidden;box-shadow:none;}.css-16h0l39+.css-16h0l39{margin-top:10px;}style><div class="css-16h0l39"><div class="SignContainer-content"><div class="SignContainer-inner"><div><form novalidate="" class="SignFlow Login-content"><div class="SignFlow-tabs"><div class="SignFlow-tab SignFlow-tab--active" role="button" tabindex="0">验证码登录div><div class="SignFlow-tab" role="button" tabindex="0">密码登录div>div><div class="SignFlow-account"><div class="SignFlowInput SignFlow-accountInputContainer"><label class="SignFlow-accountInput Input-wrapper"><input type="tel" value="" name="username" class="Input username-input" placeholder="手机号"/>label><div class="SignFlowInput-errorMask SignFlowInput-requiredErrorMask SignFlowInput-errorMask--hidden">div>div>div><div class="SignFlow SignFlow-smsInputContainer"><div class="SignFlowInput SignFlow-smsInput"><label class="Input-wrapper"><input type="number" value="" name="digits" class="Input username-input" placeholder="输入 6 位短信验证码"/>label><div class="SignFlowInput-errorMask SignFlowInput-requiredErrorMask SignFlowInput-errorMask--hidden">div>div><button type="button" class="Button CountingDownButton SignFlow-smsInputButton Button--plain">获取短信验证码button>div><div class="Login-options"><button type="button" class="Button Login-switchType Button--plain">button><button type="button" class="Button Login-cannotLogin Button--plain"><div>获取语音验证码div>button>div><button type="submit" class="Button SignFlow-submitButton Button--primary Button--blue">登录/注册button>form>div><div><span style="position:absolute;top:-10000px;left:-10000px" role="log" aria-live="assertive">span>div>div>div><style data-emotion-css="d9yzea">.css-d9yzea{margin:0 24px 12px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}style><style data-emotion-css="jr78vv">.css-jr78vv{box-sizing:border-box;margin:0;min-width:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0 24px 12px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}style><div class="css-jr78vv"><style data-emotion-css="t703mf">.css-t703mf{box-sizing:border-box;margin:0;min-width:0;border-top:1px solid;border-color:#EBEBEB;width:124px;}style><div class="css-t703mf">div><style data-emotion-css="daoszp">.css-daoszp{box-sizing:border-box;margin:0;min-width:0;color:#999999;font-size:12px;margin-left:16px;margin-right:16px;width:72px;overflow:hidden;line-height:17px;white-space:nowrap;}style><div class="css-daoszp">其他方式登录div><div class="css-t703mf">div>div><div class="Login-socialLogin"><span class="Login-socialButtonGroup"><button type="button" class="Button Login-socialButton Button--plain"><svg width="24" height="24" fill="none" viewBox="0 0 24 24" data-new-api="Wechat24" data-old-api="Wechat24" class="ZDI ZDI--Wechat24"><path fill="#07C160" d="M20.314 18.59c1.333-.968 2.186-2.397 2.186-3.986 0-2.91-2.833-5.27-6.325-5.27-3.494 0-6.325 2.36-6.325 5.27 0 2.911 2.831 5.271 6.325 5.271a7.465 7.465 0 002.064-.288l.186-.029c.122 0 .232.038.336.097l1.386.8.12.04a.21.21 0 00.212-.211l-.034-.154-.285-1.063-.023-.135a.42.42 0 01.177-.343zM9.09 3.513C4.9 3.514 1.5 6.346 1.5 9.84c0 1.905 1.022 3.622 2.622 4.781a.505.505 0 01.213.412l-.026.16-.343 1.276-.04.185c0 .14.113.254.252.254l.146-.047 1.663-.96a.793.793 0 01.403-.116l.222.032c.806.231 1.64.348 2.478.348l.417-.01a4.888 4.888 0 01-.255-1.55c0-3.186 3.1-5.77 6.923-5.77l.411.011c-.57-3.02-3.71-5.332-7.494-5.332zm4.976 10.248a.843.843 0 110-1.685.843.843 0 010 1.684v.001zm4.217 0a.843.843 0 110-1.685.843.843 0 010 1.684v.001zM6.561 8.827a1.012 1.012 0 110-2.023 1.012 1.012 0 010 2.023zm5.061 0a1.012 1.012 0 110-2.023 1.012 1.012 0 010 2.023z" clip-rule="evenodd">path>svg>button><button type="button" class="Button Login-socialButton Button--plain"><svg width="24" height="24" viewBox="0 0 24 24" data-new-api="Qq24" data-old-api="Qq24" fill="#50C8FD" class="ZDI ZDI--Qq24"><path d="M12.003 2c-2.265 0-6.29 1.364-6.29 7.325v1.195S3.55 14.96 3.55 17.474c0 .665.17 1.025.281 1.025.114 0 .902-.483 1.748-2.072 0 0-.18 2.197 1.904 3.967 0 0-1.77.495-1.77 1.182 0 .686 4.078.43 6.29 0 2.239.425 6.288.687 6.288 0 0-.688-1.77-1.182-1.77-1.182 2.086-1.77 1.906-3.967 1.906-3.967.845 1.588 1.634 2.072 1.746 2.072.111 0 .283-.36.283-1.025 0-2.514-2.165-6.954-2.165-6.954V9.325C18.29 3.364 14.268 2 12.003 2z" fill-rule="evenodd" clip-rule="evenodd">path>svg>button><button type="button" class="Button Login-socialButton Button--plain"><svg width="24" height="24" fill="none" viewBox="0 0 24 24" data-new-api="Weibo24" data-old-api="Weibo24" class="ZDI ZDI--Weibo24"><path fill="#FB6622" d="M15.518 3.06c8.834-.854 7.395 7.732 7.394 7.731-.625 1.44-1.673.31-1.673.31.596-7.52-5.692-6.33-5.692-6.33-.898-1.067-.03-1.71-.03-1.71zm4.13 6.985c-.66 1.01-1.376.126-1.375.126.205-3.179-2.396-2.598-2.396-2.598-.72-.765-.091-1.346-.091-1.346 4.882-.55 3.863 3.818 3.863 3.818zM5.318 7.52s4.615-3.86 6.443-1.328c0 0 .662 1.08-.111 2.797.003-.003 3.723-1.96 5.408.16 0 0 .848 1.094-.191 2.648 0 0 2.918-.099 2.918 2.715 0 2.811-4.104 6.44-9.315 6.44-5.214 0-8.026-2.092-8.596-3.102 0 0-3.475-4.495 3.444-10.33zm10.448 7.792s.232-4.41-5.71-4.207c-6.652.231-6.58 4.654-6.58 4.654.022.39.098 3.713 5.843 3.713 5.98 0 6.447-4.16 6.447-4.16zm-9.882.86s-.06-3.632 3.804-3.56c3.412.06 3.206 3.164 3.206 3.164s-.026 2.98-3.684 2.98c-3.288 0-3.326-2.584-3.326-2.584zm2.528 1.037c.672 0 1.212-.447 1.212-.998 0-.55-.543-.998-1.212-.998-.672 0-1.215.447-1.215.998 0 .551.546.998 1.215.998z" clip-rule="evenodd">path>svg>button>span>div><div class="SignContainer-tip">未注册手机验证后自动登录,注册即代表同意<a href="https://www.zhihu.com/term/zhihu-terms">《知乎协议》a><a href="https://www.zhihu.com/term/privacy">《隐私保护指引》a>div>div>div>div>div><footer class="SignFlowHomepage-footer"><div class="ZhihuLinks"><a target="_blank" rel="noopener noreferrer" href="https://zhuanlan.zhihu.com">知乎专栏a><a target="_blank" rel="noopener noreferrer" href="/roundtable">圆桌a><a target="_blank" rel="noopener noreferrer" href="/explore">发现a><a target="_blank" rel="noopener noreferrer" href="/app">移动应用a><a target="_blank" rel="noopener noreferrer" href="/contact">联系我们a><a target="_blank" rel="noopener noreferrer" href="https://app.mokahr.com/apply/zhihu">来知乎工作a><a target="_blank" rel="noopener noreferrer" href="/org/signup">注册机构号a><a target="_blank" rel="noopener noreferrer" href="//ir.zhihu.com">Investor Relationsa>div><div class="ZhihuRights"><span>© 2022 知乎span><a target="_blank" rel="noopener noreferrer" href="https://tsm.miit.gov.cn/dxxzsp/">京 ICP 证 110745 号a><a target="_blank" rel="noopener noreferrer" href="https://beian.miit.gov.cn/">京 ICP 备 13052560 号 - 1a><a target="_blank" rel="noopener noreferrer" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802020088"><img alt="" src="https://pic3.zhimg.com/80/v2-d0289dc0a46fc5b15b3363ffa78cf6c7.png"/>京公网安备 11010802020088 号a><a target="_blank" rel="noopener noreferrer" href="https://www.zhihu.com/certificates">京网文[2022]2674-081 号a><a href="https://pic4.zhimg.com/v2-69619662ff377c3741d92bb6fd46b7ca.png" target="_blank" rel="noopener noreferrer">出版物经营许可证a><a href="https://pic3.zhimg.com/v2-c280f8bce57f9b045b83185384d86027.png" target="_blank" rel="noopener noreferrer">药品医疗器械网络信息服务备案(京)网药械信息备字(2022)第00334号a>div><div class="ZhihuReports"><a target="_blank" rel="noopener noreferrer" href="https://zhuanlan.zhihu.com/p/28852607">侵权举报a><a target="_blank" rel="noopener noreferrer" href="http://www.12377.cn">网上有害信息举报专区a><a target="_blank" rel="noopener noreferrer" href="/term/child-jubao">儿童色情信息举报专区a><a target="_blank" rel="noopener noreferrer" href="/term/algorithm-recommend-report">互联网算法推荐举报专区a><span>违法和不良信息举报:010-82716601span><a href="mailto:jubao@zhihu.com">举报邮箱:jubao@zhihu.coma>div><style data-emotion-css="1xaekgw">.css-1xaekgw{margin-top:20px;}style><div class="css-1xaekgw"><style data-emotion-css="1170n61">.css-1170n61{vertical-align:bottom;}style><img loading="lazy" width="80" height="38" src="https://pica.zhimg.com/80/v2-ccdb7828c12afff31a27e51593d23260_720w.png" alt="本站提供适老化无障碍服务" class="css-1170n61"/>div>footer>div>div>main><div data-zop-usertoken="{}">div>div>div><script id="js-clientConfig" type="text/json">{"fetchRoot":{"www":"https:\u002F\u002Fwww.zhihu.com","api":"https:\u002F\u002Fapi.zhihu.com","lens":"https:\u002F\u002Flens.zhihu.com","zhuanlan":"https:\u002F\u002Fzhuanlan.zhihu.com","walletpay":"https:\u002F\u002Fwalletpay.zhihu.com","captcha":"https:\u002F\u002Fcaptcha.zhihu.com","vzuu":"https:\u002F\u002Fv.vzuu.com","openapi":"https:\u002F\u002Fopenapi.zhihu.com","svip":"https:\u002F\u002Fsvip.zhihu.com"},"host":"zhihu.com","protocol":"https:","wwwHost":"www.zhihu.com","videoHost":"video.zhihu.com","allowSignUp":true,"refreshValidityPeriod":"30","refreshLimit":"0.4"}script><script id="js-initialData" type="text/json">{"initialState":{"common":{"ask":{}},"loading":{"global":{"count":0},"local":{}},"club":{"tags":{},"admins":{"data":[]},"members":{"data":[]},"profile":{},"checkin":{},"comments":{"paging":{},"loading":{},"meta":{},"ids":{}},"postList":{"paging":{},"loading":{},"ids":{}},"recommend":{"data":[]},"silences":{"data":[]},"application":{"profile":null}},"entities":{"users":{},"questions":{},"answers":{},"articles":{},"columns":{},"topics":{},"roundtables":{},"favlists":{},"comments":{},"notifications":{},"ebooks":{},"activities":{},"feeds":{},"pins":{},"promotions":{},"drafts":{},"chats":{},"posts":{},"clubs":{},"clubTags":{},"zvideos":{},"zvideoContributions":{},"briefs":{},"eduCourses":{}},"currentUser":"","account":{"lockLevel":{},"unlockTicketStatus":false,"unlockTicket":null,"challenge":[],"errorStatus":false,"message":"","isFetching":false,"accountInfo":{},"urlToken":{"loading":false},"cardUserInfo":{"vipInfo":{}},"handleWidget":{},"widgetList":[],"userWidgetId":""},"settings":{"socialBind":null,"inboxMsg":null,"notification":{},"email":{},"privacyFlag":null,"blockedUsers":{"isFetching":false,"paging":{"pageNo":1,"pageSize":6},"data":[]},"blockedFollowees":{"isFetching":false,"paging":{"pageNo":1,"pageSize":6},"data":[]},"ignoredTopics":{"isFetching":false,"paging":{"pageNo":1,"pageSize":6},"data":[]},"restrictedTopics":null,"laboratory":{}},"notification":{},"people":{"profileStatus":{},"activitiesByUser":{},"answersByUser":{},"answersSortByVotesByUser":{},"answersIncludedByUser":{},"votedAnswersByUser":{},"thankedAnswersByUser":{},"voteAnswersByUser":{},"thankAnswersByUser":{},"topicAnswersByUser":{},"zvideosByUser":{},"articlesByUser":{},"articlesSortByVotesByUser":{},"articlesIncludedByUser":{},"pinsByUser":{},"questionsByUser":{},"commercialQuestionsByUser":{},"favlistsByUser":{},"followingByUser":{},"followersByUser":{},"mutualsByUser":{},"followingColumnsByUser":{},"followingQuestionsByUser":{},"followingFavlistsByUser":{},"followingTopicsByUser":{},"publicationsByUser":{},"columnsByUser":{},"allFavlistsByUser":{},"brands":null,"creationsByUser":{},"creationsSortByVotesByUser":{},"creationsFeed":{},"infinity":{},"batchUsers":{},"profileInfinity":null},"env":{"ab":{"config":{"params":[{"id":"vessay_v2_sdk","type":"Int","value":"1","layerId":"Qtkm"},{"id":"pc_ppt_publish","type":"Int","value":"0","layerId":"pc_ppt_publish"},{"id":"helpcenter_pc","type":"Int","value":"0","layerId":"helpcenter_pc"},{"id":"pc_comment","type":"Int","value":"0","layerId":"EsOR"},{"id":"pc_follow","type":"Int","value":"1","layerId":"pc_follow"},{"id":"pc_player_rp","type":"Int","value":"0","layerId":"pc_player_rp"},{"id":"use_biz_comment","type":"Int","value":"0","layerId":"use_biz_comment"},{"id":"pc_pin","type":"Int","value":"0","layerId":"pc_pin"}],"experiments":[{"expId":"pc_follow-3_v5","expPrefix":"pc_follow","isDynamicallyUpdated":false,"isRuntime":false,"includeTriggerInfo":false}],"chains":[{"chainId":"_all_"}],"encodedParams":"CsQBCAAbAD8ARwC0AGkBagF0ATsCzALXAtgCTwNQA6ADoQOiA7cD8wP0AzMEjASNBKYE1gQRBVEFiwWMBZ4FMAYxBusGJwd3B3gH2AfcB90HZwh0CHYIeQjaCD8JQglgCY0JwwnECcUJxgnHCcgJyQnKCcsJzAnRCfEJ9AkECkkKZQprCpgKpQqpCr4KxArUCt0K7Qr9Cv4KOws8C0MLRgtxC3YLhQuHC40LwAvXC+AL5QvmCywMOAxxDI8MrAy5DMMMyQz4DBJiAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAA="},"triggers":{}},"userAgent":{"Edge":false,"IE":false,"Wechat":false,"Weibo":false,"QQ":false,"MQQBrowser":false,"Qzone":false,"Mobile":false,"Android":false,"iOS":false,"isAppleDevice":false,"Zhihu":false,"ZhihuHybrid":false,"isBot":false,"Tablet":false,"UC":false,"Quark":false,"Sogou":false,"Qihoo":false,"Baidu":false,"BaiduApp":false,"Safari":false,"GoogleBot":false,"AndroidDaily":false,"iOSDaily":false,"WxMiniProgram":false,"BaiduMiniProgram":false,"QQMiniProgram":false,"JDMiniProgram":false,"isWebView":false,"isMiniProgram":false,"origin":"python-requests\u002F2.28.1"},"appViewConfig":{},"ctx":{"path":"\u002Fsignin","query":{"next":"\u002F"},"href":"http:\u002F\u002Fwww.zhihu.com\u002Fsignin?next=%2F","host":"www.zhihu.com"},"trafficSource":"production","edition":{"beijing":false,"baidu":false,"sogou":false,"baiduBeijing":false,"sogouBeijing":false,"sogouInput":false,"baiduSearch":false,"googleSearch":false,"shenma":false,"miniProgram":false,"xiaomi":false},"theme":"light","appHeaderTheme":{"current":"normal","disable":true,"normal":{"bgColor":"GBK99A"},"custom":{"bgColor":"GBK99A"}},"enableShortcut":true,"referer":"","xUDId":"","mode":"ssr","conf":{},"xTrafficFreeOrigin":"","ipInfo":{},"logged":false,"vars":{"passThroughHeaders":{}}},"me":{"columnContributions":[]},"label":{"recognizerLists":{}},"ecommerce":{},"comments":{"pagination":{},"collapsed":{},"reverse":{},"reviewing":{},"conversation":{},"parent":{}},"commentsV2":{"stickers":[],"commentWithPicPermission":{},"notificationsComments":{},"pagination":{},"collapsed":{},"reverse":{},"reviewing":{},"conversation":{},"conversationMore":{},"parent":{}},"pushNotifications":{"default":{"isFetching":false,"isDrained":false,"ids":[]},"follow":{"isFetching":false,"isDrained":false,"ids":[]},"vote_thank":{"isFetching":false,"isDrained":false,"ids":[]},"currentTab":"default","notificationsCount":{"default":0,"follow":0,"vote_thank":0}},"messages":{"data":{},"currentTab":"common","messageCount":0},"register":{"registerValidateSucceeded":null,"registerValidateErrors":{},"registerConfirmError":null,"sendDigitsError":null,"registerConfirmSucceeded":null},"login":{"loginUnregisteredError":false,"loginBindWechatError":false,"loginConfirmError":null,"sendDigitsError":null,"needSMSIdentify":false,"validateDigitsError":false,"loginConfirmSucceeded":null,"qrcodeLoginToken":"","qrcodeLoginScanStatus":0,"qrcodeLoginError":null,"qrcodeLoginReturnNewToken":false},"switches":{},"captcha":{"captchaNeeded":false,"captchaValidated":false},"sms":{"supportedCountries":[]},"chat":{"chats":{},"inbox":{"recents":{"isFetching":false,"isDrained":false,"isPrevDrained":false,"result":[],"next":null,"key":null},"strangers":{"isFetching":false,"isDrained":false,"isPrevDrained":false,"result":[],"next":null,"key":null},"friends":{"isFetching":false,"isDrained":false,"isPrevDrained":false,"result":[],"next":null,"key":null},"search":{"isFetching":false,"isDrained":false,"isPrevDrained":false,"result":[],"next":null,"key":null},"config":{"newCount":0,"strangerMessageSwitch":false,"strangerMessageUnread":false,"friendCount":0}},"global":{"isChatMqttExisted":false}},"emoticons":{"emoticonGroupList":[],"emoticonGroupDetail":{}},"creator":{"currentCreatorUrlToken":null,"homeData":{"recommendQuestions":[]},"tools":{"question":{"invitationCount":{"questionFolloweeCount":0,"questionTotalCount":0},"goodatTopics":[]},"customPromotion":{"itemLists":{}},"recommend":{"recommendTimes":{}}},"explore":{"academy":{"tabs":[],"article":{}}},"rights":[],"newRights":[],"rightsStatus":{},"levelUpperLimit":10,"account":{"growthLevel":{}},"mcn":{},"applyStatus":{},"videoSupport":{},"textBenefit":{},"mcnManage":{},"tasks":{},"newTasks":{"creatorTask":{"tasks":[],"des":[]}},"scoreInfo":{},"recentlyCreated":[],"analysis":{"all":{},"answer":{},"zvideo":{},"article":{},"pin":{},"singleContent":{}},"announcement":{},"bannerList":[],"school":{"tabs":[],"contents":[],"banner":null,"entities":{}},"creatorsRecommendInfo":{},"menusShowControlByServer":{"bVipRecomend":false,"creationRelationship":false},"income":{"aggregation":{}}},"question":{"followers":{},"concernedFollowers":{},"answers":{},"hiddenAnswers":{},"updatedAnswers":{},"ariaAnswers":{},"collapsedAnswers":{},"notificationAnswers":{},"invitedQuestions":{"total":{"count":null,"isEnd":false,"isLoading":false,"questions":[]},"followees":{"count":null,"isEnd":false,"isLoading":false,"questions":[]}},"laterQuestions":{"count":null,"isEnd":false,"isLoading":false,"questions":[]},"waitingQuestions":{"recommend":{"isEnd":false,"isLoading":false,"questions":[]},"invite":{"isEnd":false,"isLoading":false,"questions":[]},"newest":{"isEnd":false,"isLoading":false,"questions":[]},"hot":{"isEnd":false,"isLoading":false,"questions":[]}},"invitationCandidates":{},"inviters":{},"invitees":{},"similarQuestions":{},"questionBanners":{},"relatedCommodities":{},"bio":{},"brand":{},"permission":{},"adverts":{},"advancedStyle":{},"commonAnswerCount":0,"hiddenAnswerCount":0,"topicMeta":{},"bluestarRanklist":{},"relatedSearch":{},"autoInvitation":{},"simpleConcernedFollowers":{},"draftStatus":{},"disclaimers":{},"isShowMobileSignInModal":false},"shareTexts":{},"answers":{"voters":{},"copyrightApplicants":{},"favlists":{},"newAnswer":{},"entityWords":{},"concernedUpvoters":{},"simpleConcernedUpvoters":{},"paidContent":{},"settings":{}},"banner":{},"topic":{"bios":{},"hot":{},"newest":{},"top":{},"sticky":{},"pin":{},"unanswered":{},"questions":{},"followers":{},"contributors":{},"parent":{},"children":{},"bestAnswerers":{},"wikiMeta":{},"index":{},"intro":{},"meta":{},"schema":{},"creatorWall":{},"wikiEditInfo":{},"committedWiki":{},"landingBasicData":{},"landingExcellentItems":[],"landingExcellentEditors":[],"landingCatalog":[],"landingEntries":{}},"explore":{"recommendations":{},"specials":{"entities":{},"order":[]},"roundtables":{"entities":{},"order":[]},"collections":{},"columns":{},"square":{"hotQuestionList":[],"potentialList":[]}},"articles":{"voters":{},"concernedUpvoters":{}},"favlists":{"relations":{}},"pins":{"reviewing":{}},"topstory":{"recommend":{"isFetching":false,"isDrained":false,"afterId":0,"items":[],"next":null},"follow":{"isFetching":false,"isDrained":false,"afterId":0,"items":[],"next":null},"room":{"meta":{},"isFetching":false,"afterId":0,"items":[],"next":null},"followWonderful":{"isFetching":false,"isDrained":false,"afterId":0,"items":[],"next":null},"sidebar":null,"announcement":{},"hotList":[],"guestFeeds":{"isFetching":false,"isDrained":false,"afterId":0,"items":[],"next":null},"followExtra":{"isNewUser":null,"isFetched":false,"followCount":0,"followers":[]},"hotDaily":{"data":[],"paging":{}},"hotHighlight":{"isFetching":false,"isDrained":false,"data":[],"paging":{}},"banner":{},"commercialBanner":{"show":false,"banner":{},"trackData":{}},"video":{"items":[],"next":null,"isLoading":false,"isDrained":false}},"upload":{},"video":{"data":{},"shareVideoDetail":{},"last":{}},"zvideos":{"campaignVideoList":{},"campaigns":{},"tagoreCategory":[],"recommendations":{},"insertable":{},"recruit":{"form":{"platform":"","nickname":"","followerCount":"","domain":"","contact":""},"submited":false,"ranking":[]},"club":{},"qyActivityData":{},"talkActivityData":{},"party2022ActivityData":{},"batchVideos":{},"contribution":{"selectedContribution":null,"campaign":null,"configs":{},"contributionLists":{},"recommendQuestions":{"isLoading":true,"paging":{"isEnd":false,"isStart":true,"totals":0},"data":[]},"questionSearchResults":{"isLoading":true,"paging":{"isEnd":false,"isStart":true,"totals":0},"data":[]}},"creationReferences":{},"zvideoCollection":{},"zvideoGrant":{},"collectData":{"isFetching":false,"list":[]},"videoSource":{"isLoaded":false}},"guide":{"guide":{"isFetching":false,"isShowGuide":false}},"reward":{"answer":{},"article":{},"question":{}},"search":{"recommendSearch":[],"topSearch":{},"searchValue":{},"suggestSearch":{},"attachedInfo":{"generalByQuery":{}},"nextOffset":{"generalByQuery":{}},"topicReview":{},"calendar":{},"scores":null,"majors":{},"university":{},"generalByQuery":{},"generalByQueryInADay":{},"generalByQueryInAWeek":{},"generalByQueryInThreeMonths":{},"peopleByQuery":{},"topicByQuery":{},"zvideoByQuery":{},"scholarByQuery":{},"columnByQuery":{},"liveByQuery":{},"albumByQuery":{},"eBookByQuery":{},"kmGeneralByQuery":{},"kmCourseByQuery":{},"customFilter":{"requestFinished":false,"keys":[],"tags":[]}},"creatorSalt":{"recommendQuestionList":[],"bannerList":[],"claimBannerList":[],"sites":[],"domains":{},"hasRecored":false,"hasClaim":false,"hasContributedList":[],"notContributedList":[],"contributesTotal":null,"previewPageTitle":"","previewPageContent":"","restContributionNumber":"-"},"publicEditPermission":{},"vessay":{"common":{"draftId":null,"source":{"type":null,"id":null},"autoSave":true,"blockUnload":true,"isCalibratingEditing":false,"editingTrackData":{"editingOutlines":[],"editingVideos":[]},"newAddMaterialData":{},"audioCache":{},"showTimbreRecordPanel":false},"loading":{"isLoading":true,"text":"开始初始化"},"player":{"currentTime":0,"totalTime":0,"playing":false,"containerSize":null},"library":{"material":{},"materialSearchResult":{},"music":{},"musicLibraryCategories":[],"musicUrls":{}},"track":{"trackData":{"dataVersion":1,"videoTrack":[],"audioTrack":[],"musicTrack":[],"voiceOverData":{}},"extra":{"themeId":null},"previewEditingTrackData":{"editingSubtitleItem":{},"editingVideoItem":{}},"selectedTrackItems":[],"outlineRemoveMaterial":{},"outlineAppliedStyle":{},"timbres":[],"timbreId":"","timbreTests":[],"newRecordBlob":{},"exportErrorUrls":[],"defaultTimbreId":"1"}},"readStatus":{},"draftHistory":{"history":{},"drafts":{}},"notifications":{"recent":{"isFetching":false,"isDrained":false,"isPrevDrained":false,"result":[],"next":null,"key":null},"history":{"isFetching":false,"isDrained":false,"isPrevDrained":false,"result":[],"next":null,"key":null},"notificationActors":{"isFetching":false,"isDrained":false,"isPrevDrained":false,"result":[],"next":null,"key":null},"recentNotificationEntry":"all"},"specials":{"entities":{},"all":{"data":[],"paging":{},"isLoading":false}},"collections":{"hot":{"data":[],"paging":{},"isLoading":false},"collectionFeeds":{}},"userProfit":{"permission":{"permissionStatus":{"zhiZixuan":0,"recommend":-1,"task":0,"plugin":0,"infinity":0},"visible":false}},"mcn":{"bindInfo":{},"memberCategoryList":[],"producerList":[],"categoryList":[],"lists":{},"banners":{},"protocolStatus":{"isAgreedNew":true,"isAgreedOld":true},"probationCountdownDays":0},"mcnActivity":{"household":{"products":{},"rankList":{"total":{},"yesterday":{}}}},"brand":{"contentPlugin":{}},"host":{"roundtable":{"subjects":{},"applications":{"total":0},"online":{"total":0},"applies":{},"details":{},"includedResource":{},"hotQuestions":{},"warmupContents":{},"batchInclude":{}},"special":{"applications":{"total":0,"pages":{},"entities":{}},"censorHistory":{},"drafts":{}}},"campaign":{"single":{},"list":{},"videoMakerAcq":{},"vote":{},"cardCollecting":{"message":null,"profile":{"balance":"0","chance":0,"coinNum":0,"gatherClose":false,"isGotMagicCard":false,"isPay":false,"partitionStart":false,"totalDone":0,"withdrawStart":false},"sharePoster":{"share":"","sendCard":"","invite":""},"shareLink":null,"shareIntention":"share","shareKey":null,"shareCardId":null,"inviterInfo":null,"giverInfo":null,"prize":null,"receivedCard":null,"newCoinCount":null,"newCardList":[],"newUserCardCount":1,"taskList":[],"prizeList":null,"cardList":null,"panel":{"showTaskPanel":false,"showRewardPanel":false},"modal":{"showWelcomeModal":false,"showFusionModal":false,"showFusionPromptModal":false,"showShareModal":false,"showBackModal":false}},"zhiboPandian2020":null,"boarding":{},"searchGaokaoSubPage":{},"searchHealth":{}},"knowledgePlan":{"lists":{},"allCreationRankList":{},"featuredQuestions":{}},"wallE":{"protectHistory":{"total":0,"pages":{},"entities":{}}},"roundtables":{"hotQuestions":{},"warmupContents":{},"hotDiscussions":{},"selectedContents":{},"roundtables":{}},"helpCenter":{"entities":{"question":{},"category":{}},"categories":[],"commonQuestions":[],"relatedQuestions":{},"faqTypes":[]},"republish":{},"commercialReport":{"commercialTypes":[]},"creatorMCN":{"mcn":{},"mcnStatistics":{},"isNoAuth":false,"creatorManageData":[],"creatorManageDataTotal":1,"mcnDomains":[]},"commentManage":{"commentList":{"ids":[],"entities":{},"nextOffset":0,"urlToken":""},"subCommentList":{"ids":[],"entities":{},"paging":{"next":"","isEnd":false}}},"commentPermission":{},"creatorRightStatus":{"list":[]},"zhiPlus":{"permissionStatus":9999},"streaming":{},"creationRanking":{},"eduSections":{"eduSectionState":{}}},"subAppName":"main"}script><script crossorigin="" src="https://static.zhihu.com/heifetz/vendor.bb0d1883d504a44a67b0.js">script><script crossorigin="" src="https://static.zhihu.com/heifetz/main.lib_09e9ad9b.f2618dbb3020a8fac1f6.js">script><script crossorigin="" src="https://static.zhihu.com/heifetz/main.app.3fa3a73250c3b9790a4c.js">script><script crossorigin="" src="https://static.zhihu.com/heifetz/main.shared_05fdcb6c7efff2d88d20b6f2c3d1bd3ad9f2b21d.7df8282400dc5aa71736.js">script><script crossorigin="" src="https://static.zhihu.com/heifetz/main.sign-page.3f7a1f27229b24e4e040.js">script><script defer="" src="https://static.zhihu.com/event/wza/31035/aria.js?appid=a3637ace5dc3a347f6863b0bac487599">script>body><script src="https://hm.baidu.com/hm.js?98beee57fd2ef70ccdd5ca52b9740c49" async="">script>html>
    
    • 1
    • 2
    • 3

    test

    import requests
    
    while True:
        headers = {
            'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
        }
        response = requests.get('https://movie.douban.com/top250', headers=headers)
        if response.status_code != 200:
            print('恭喜IP被封!')
            break
        else:
            print('加油!')
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
  • 相关阅读:
    Python全栈开发[基础-01] 计算机基础入门
    java计算机毕业设计瀚绅睿茨二人二轮车租赁管理源码+mysql数据库+系统+lw文档+部署
    在 Windows 中使用 System Settings
    低代码助力生产管理:车间管理系统
    vue与C#实现自定义表单审批流程构建-前端
    4. algorithm
    写给学生的一点建议-如何构建自己的知识体系?
    GCC优化相关
    2023年中国稻谷加工机械分类、市场规模及发展前景分析[图]
    Unity 阴影——阴影平坠(Shadow pancaking)
  • 原文地址:https://blog.csdn.net/weixin_43600905/article/details/127434691