当前位置: 首页 > news >正文

爬虫逆向网站案例

一、相关网页

东方财富人气排行榜

二、查找url

三、寻找curl并复制

四、打开Convert curl commands to code (curlconverter.com)

五、修改并执行代码

import requestscookies = {'st_si': '73974981954644','st_pvi': '39724919122964','st_sp': '2024-03-05%2018%3A27%3A22','st_inirUrl': '','st_sn': '1','st_psi': '20240305182722293-117001314791-4005509623','st_asi': 'delete',
}headers = {'Accept': '*/*','Accept-Language': 'zh-CN,zh;q=0.9','Connection': 'keep-alive',# 'Cookie': 'st_si=73974981954644; st_pvi=39724919122964; st_sp=2024-03-05%2018%3A27%3A22; st_inirUrl=; st_sn=1; st_psi=20240305182722293-117001314791-4005509623; st_asi=delete','Referer': 'https://guba.eastmoney.com/','Sec-Fetch-Dest': 'script','Sec-Fetch-Mode': 'no-cors','Sec-Fetch-Site': 'same-site','User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36','sec-ch-ua': '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"','sec-ch-ua-mobile': '?0','sec-ch-ua-platform': '"Windows"',
}response = requests.get('https://push2.eastmoney.com/api/qt/ulist.np/get?fltt=2&np=3&ut=a79f54e3d4c8d44e494efb8f748db291&invt=2&secids=0.002875,0.000625,0.000938,0.002369,1.600895,0.300290,0.300364,1.603083,1.603721,0.000868,1.601360,0.000063,0.300735,0.002855,1.603220,0.300308,0.000670,0.002217,0.002177,1.600520&fields=f1,f2,f3,f4,f12,f13,f14,f152,f15,f16',cookies=cookies,headers=headers,
).text
print(response)

六、执行结果

七、搜索网页信息

http://www.lryc.cn/news/311712.html

相关文章:

  • 蓝桥杯复习之前缀和
  • 动态规划(算法竞赛、蓝桥杯)--背包DP求具体方案
  • go写mysql取得自增字段值
  • Vue 3的Composition API和vue2的不同之处
  • go语言基础 -- 面向对象编程
  • HarmonyOS—编译构建概述
  • 下载element-ui 资源,图标 element-icons.woff,element-icons.ttf 无法解码文件字体
  • Flutter整体框架
  • JVM堆内存中新生代晋升到老年代的条件
  • 前端监控为什么采用GIF图片做埋点?
  • webstorm 创建运行纯Typescript项目
  • GO-接口
  • 【C语言】动态内存管理常用函数
  • 【OpenGL】(1) 专栏介绍:OpenGL 库 | 3D 计算机图形应用 | GPGPU 计算 | 3D 建模和 3D动画 | 渲染技术介绍
  • SPI总线知识总结
  • 【异常关闭clas*h,导致无法访问任何网页_解决办法】
  • STL-map和set
  • [蓝桥杯 2020 省 B1] 整除序列
  • 【Android】View 的滑动
  • 基于ZYNQ的PCIE高速数据采集卡的设计(一)
  • 渗透测试工具 nmap 详解
  • Ubuntu下安装Scala
  • 无法启动报,To install it, you can run: npm install --save @/components/iFrame/index
  • 深入理解现代JavaScript:从语言特性到应用实践
  • ThreadPoolExecutor 学习
  • 深入理解计算机操作系统书籍阅读感悟(一)
  • 使用query请求数据出现500的报错
  • PostgreSQL教程(二十一):服务器管理(三)之服务器设置和操作
  • Linux运维_Bash脚本_编译安装GNU-Tools
  • leetcode 121.买卖股票的最佳时机