【发布时间】:2023-01-12 21:27:24
【问题描述】:
我正在使用 Selenium-wire 尝试读取某些网络流量的请求响应文本。我拥有的代码无法完全重现,因为该帐户位于付费专区后面。
我目前使用的硒线是:
for request in driver.requests:
if request.method == 'POST' and request.headers['Content-Type'] == 'application/json':
# The body is in bytes so convert to a string
body = driver.last_request.body.decode('utf-8')
# Load the JSON
data = json.loads(body)
【问题讨论】:
标签: python selenium selenium-webdriver seleniumwire