Closed
Description
I want to fetch all requests similar https://www.dilatoit.com/2020/12/17/how-to-capture-http-requests-using-selenium.html
from seleniumwire import webdriver # Import from seleniumwire
# Create a new instance of the Firefox driver
driver = webdriver.Firefox()
# Go to the Google home page
driver.get('https://www.google.com')
# Access and print requests via the `requests` attribute
for request in driver.requests:
if request.response:
print(
request.url,
request.response.status_code,
request.response.headers['Content-Type'])
How can i do with seleniumbase.?
I try to use
for request in sb.driver.requests:
if request.response:
print(f"{request.url}\n{request.response.status_code}\n{request.response.headers['Content-Type']}")
But it give me error
AttributeError: 'Chrome' object has no attribute 'requests'