zoukankan      html  css  js  c++  java
  • requests设置代理ip

    # coding=utf-8
    
    import requests
    
    url = "http://test.yeves.cn/test_header.php"
    
    headers = {
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36",
        "referer": "https://www.pexels.com/zh-cn/photo/4k-1484728/"
    }
    
    data = {"id": 1, "name": "wang"}
    proxy = {
        "http":"http://218.21.230.156:808"
    }
    response = requests.post(url, headers=headers, data=data,proxies=proxy)
    print(response.json()) "referer": "https://www.pexels.com/zh-cn/photo/4k-1484728/"
    }
    
    data = {"id": 1, "name": "wang"}
    proxy = {
        "http":"http://218.21.230.156:808"
    }
    response = requests.post(url, headers=headers, data=data,proxies=proxy)
    print(response.json())
  • 相关阅读:
    [手游新项目历程]-36- error: stray ‘357’ in program
    广告学(一)
    VMware的Unity模式
    poj3709
    poj1849
    bzoj2007
    bzoj3209
    bzoj2466,poj1222
    bzoj1016
    bzoj2186
  • 原文地址:https://www.cnblogs.com/brady-wang/p/12435131.html
Copyright © 2011-2022 走看看