You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my purpose is to use Nodriver to get the response content .
But .cdp.network.get_response_body() always returns None.
This is my code.
I think my issue is similar as #1788 #1930
import asyncio
import datetime
import time
import pandas as pd
import os
import sys
from tqdm import tqdm
import nodriver as uc
sys.path.append(os.getcwd())
from utils import run_no_driver
request_ids = []
async def response_meta_handler(event):
# if 'https://api.follow.is/entries' in event.response.url:
request_id = event.request_id
request_ids.append(request_id)
print("add request_id", request_id)
with open("data/nodriver.txt", "a") as f:
f.write(str(event)+"\n")
async def run():
url = "http://www.google.com/"
driver = await run_no_driver()
tab = await driver.get("about:blank")
tab.add_handler(uc.cdp.network.ResponseReceived, response_meta_handler)
await tab.send(uc.cdp.target.set_auto_attach(True, True))
tab = await tab.get(url)
await asyncio.sleep(10)
for request_id in request_ids:
print(request_id)
a = await asyncio.wait_for(tab.send(uc.cdp.network.get_response_body(request_id)), timeout=10)
b = await asyncio.wait_for(tab.send(uc.cdp.fetch.get_response_body(request_id)), timeout=10)
print(a)
print(b)
print(123)
print(123)
print(123)
if __name__ == "__main__":
asyncio.run(run())
my purpose is to use Nodriver to get the response content .
But .cdp.network.get_response_body() always returns None.
This is my code.
I think my issue is similar as
#1788
#1930
In this code . I can get reuqest_id
like
But when I use uc.cdp.network.get_response_body(request_id) or uc.cdp.fetch.get_response_body(request_id)
I always get None like
The text was updated successfully, but these errors were encountered: