headers = { "User-Agent": "Mozilla/5.0", "Accept-Language": "en-US,en;q=0.5", } #buff_cookie=Device-Id=XLjfIKmqYdZOl13kurAk; Locale-Supported=zh-Hans; game=csgo; NTES_YD_SESS=uRfvo1tg47qUhPC.zZn1eYfeulPZJ2LrgyFtvmT21FmVZ2qhZLps8NoRt2I6u42nBEfAl0DC2kr3Q0MJx1R_cgLha79FUaGziH_Ab0547Pp.m82.XHkIJ.cB9YRyjBJhrGvBgP8AcQAJKvnEU3mUbjNiZ_PWF5vhvnUMr1J95ljN8yzPU5DYCD7xRj4i3j3Z.LgtnCnAf44KDtYtOTI1CLIWZvkZ.tg_U_TZve0Q.WMMi; S_INFO=1686062063|0|0&60##|17860971786; P_INFO=17860971786|1686062063|1|netease_buff|00&99|null&null&null#not_found&null#10#0|&0||17860971786; remember_me=U1097288259|fSimYVO9MRMclOPjMhKxdzwo4KQ8Inz5; session=1-kTFVdNzCYMqOg0xjyicwy9GNHvKIN0dMQpwIFW2fVCbE2041173275; csrf_token=ImVmYzdiN2I0NTg5MGQyY2VlZDQwMGQxNzIxOTI1ZGIzNGE1MzI0Nzgi.F2DVgA.bHasgO17bW8V-MVkHAfrdjJDMuU buff_cookie="Device-Id=XLjfIKmqYdZOl13kurAk; Locale-Supported=zh-Hans; game=csgo; NTES_YD_SESS=uRfvo1tg47qUhPC.zZn1eYfeulPZJ2LrgyFtvmT21FmVZ2qhZLps8NoRt2I6u42nBEfAl0DC2kr3Q0MJx1R_cgLha79FUaGziH_Ab0547Pp.m82.XHkIJ.cB9YRyjBJhrGvBgP8AcQAJKvnEU3mUbjNiZ_PWF5vhvnUMr1J95ljN8yzPU5DYCD7xRj4i3j3Z.LgtnCnAf44KDtYtOTI1CLIWZvkZ.tg_U_TZve0Q.WMMi; S_INFO=1686062063|0|0&60##|17860971786; P_INFO=17860971786|1686062063|1|netease_buff|00&99|null&null&null#not_found&null#10#0|&0||17860971786; remember_me=U1097288259|fSimYVO9MRMclOPjMhKxdzwo4KQ8Inz5; session=1-kTFVdNzCYMqOg0xjyicwy9GNHvKIN0dMQpwIFW2fVCbE2041173275; csrf_token=ImVmYzdiN2I0NTg5MGQyY2VlZDQwMGQxNzIxOTI1ZGIzNGE1MzI0Nzgi.F2DVgA.bHasgO17bW8V-MVkHAfrdjJDMuU" headers['Cookie'] = buff_cookie base_url="https://buff.163.com/api/market/goods/sell_order?game=csgo&goods_id=%goods_id%&page_num=1" goods_id=35245 base_url= base_url.replace('%goods_id%',str(goods_id)) print(base_url)
时间: 2024-01-31 20:16:54 浏览: 120
user_agents.txt
这段代码主要是定义了一个 HTTP 请求头 `headers`,其中包含了 User-Agent 和 Accept-Language 信息。然后定义了一个变量 `buff_cookie`,并将其赋值为一个字符串,该字符串包含了多个 cookie。接下来,将 `buff_cookie` 的值赋给了 `headers` 中的 Cookie 字段,以便在请求 Buff 网站的 API 时携带这些 cookie。然后,定义了一个变量 `base_url`,该变量表示一个 Buff 网站的 API 地址,其中包含了 `%goods_id%` 占位符。接着,将 `goods_id` 变量的值替换掉了 `%goods_id%`,并将完整的 API 地址打印出来。
阅读全文