"""
@author: luojunhui
"""
import requests
import json

url = "https://gp-api.iguopin.com/api/jobs/v1/recom-job"

payload = json.dumps({
  "search": {
    "page": 1,
    "page_size": 20
  },
  "recom": {
    "update_time": True,
    "company_nature": True,
    "hot_job": True
  }
})
headers = {
  'accept': 'application/json, text/plain, */*',
  'accept-language': 'zh,zh-CN;q=0.9',
  'content-type': 'application/json',
  'device': 'pc',
  'origin': 'https://www.iguopin.com',
  'priority': 'u=1, i',
  'referer': 'https://www.iguopin.com/',
  'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"',
  'sec-ch-ua-mobile': '?0',
  'sec-ch-ua-platform': '"macOS"',
  'sec-fetch-dest': 'empty',
  'sec-fetch-mode': 'cors',
  'sec-fetch-site': 'same-site',
  'subsite': 'iguopin',
  'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'
}

response = requests.request("POST", url, headers=headers, data=payload)
for item in response.json()['data']['list']:
    if item['recruitment_type_cn'] == '社招':
        print(json.dumps(item, ensure_ascii=False, indent=4))
