1. 程式人生 > >構造請求頭訪問頁面

構造請求頭訪問頁面

    url1 = 'https://fe-api.zhaopin.com/c/i/sou?pageSize=60&cityId=530&workExperience=-1&education=-1&companyType=-1&employmentType=-1&jobWelfareTag=-1&kw=%s&kt=3&lastUrlQuery={"pageSize":"60","jl":"530","kw":"%s","kt":"3"}&_v=0.46445097' % (company_name, company_name)
    headers = {
                'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/'
                              '537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36'
            }
res=requests.get(url,headers=headers,verify=False)
print(res.text)