当前位置:首页 > python > 正文内容

python之seleniumwire获取network(网络)信息

zhangsir4年前 (2022-10-09)python485

python之seleniumwire获取请求头参数

import time
from seleniumwire import webdriver

# 创建Chrome驱动程序的新实例
driver = webdriver.Chrome()
# 打开网页。
driver.get('https://download.csdn.net/download/qq_51714990/86738618?utm_medium=distribute.pc_feed_404.none-task-download-2~default~BlogCommendHotData~Rate-15-86738618-download-null.pc_404_mixedpudn&depth_1-utm_source=distribute.pc_feed_404.none-task-download-2~default~BlogCommendHotData~Rate-15-86738618-download-null.pc_404_mixedpudn')
time.sleep(5)
# 通过“请求”属性访问请求
for request in driver.requests:
    if request.response:
        if request.path == "/api/source/detail/v1/download":
            print(request.response.body.decode("utf-8"))
driver.quit()


zhangsir版权c2防采集https://mianka.xyz

扫描二维码推送至手机访问。

版权声明:本文由zhangsir or zhangmaam发布,如需转载请注明出处。

本文链接:https://www.mianka.xyz/post/39.html

分享给朋友:

“python之seleniumwire获取network(网络)信息” 的相关文章

Python怎么获取命令行参数

输入:“ import sys”,导入 sys 模块。插入语句:“print(sys.argv)”,打印获取的命令行参数。...

python+selenium元素定位的8种方法

定位元素,selenium提供了8中元素定位方法:(1)find_element_by_id() :html规定,id在html中必须是唯一的,有点类似于身份证号(2)find_element_by_name() :html规定,name用来指定元素的名称,有点类似于人名(3)find_elemen...

python selenium find_element_by_xpath 方法已经被弃用的解决办法

背景:在使用最新3.10.4Python版本时候,用selenium进行xpath定位元素,编译器提示:DeprecationWarning:find_element_by_xpath is deprecated. Please use find_element(by=By.XPATH, value...

计算机学习视频教程

人工智能机器学习:Python&R实践课程介绍:https://www.aihorizon.cn/1百度网盘地址: https://pan.baidu.com/s/1a743NTKFRjsgexMTagWooA?pwd=e39j动手使用Python进行自然语言处理(NLP)课程介绍:http...

python—pymysql的增删改查操作实例展示

Python使用pymysql连接数据库1.导包import pymysql2.连接数据库connection = pymysql.connect(     host='',  # ...

python selenium 使用代理ip

代码如下:from selenium import webdriver chromeOptions = webdriver.ChromeOptions() chromeOptions.add_argument("--proxy-serv...