Поэтому я изменил тело запроса POST на определенную конечную точку API и отправил его в driver.request_interceptor. Я хотел получить ответ на измененный запрос.
Ниже приведен код на Python
def request_handler():
# wait for a request to the api endpoint
req = driver.wait_for_request("/api/endpoint")
# decode the body of the request
body = req.body.decode("utf-8")
# load the json
data = json.loads(body)
# add a json property
data["name"] = "James"
# set the json back to the request
req.body = json.dumps(data).encode("utf-8")
# resend the request
def sending_intercept():
driver.request_interceptor = request_handler
Подробнее здесь: https://stackoverflow.com/questions/798 ... wire-after
Мобильная версия