Selenium Wire request doesn’t seem to work /u/frocketgaming Python Education

I’m attempting to intercept network activity on a website to get the json response I see in the ‘Preview’ tab of Chrome.

After some looking I’ve landed on Selenium Wire but even doing the example from the PyPI site it returns nothing. Any ideas of what else I could try to make this work?

from seleniumwire import webdriver # Import from seleniumwire # Create a new instance of the Chrome driver driver = webdriver.Chrome() # Go to the Google home page driver.get("https://www.google.com") # Access 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"], ) 

submitted by /u/frocketgaming
[link] [comments]

​r/learnpython I’m attempting to intercept network activity on a website to get the json response I see in the ‘Preview’ tab of Chrome. After some looking I’ve landed on Selenium Wire but even doing the example from the PyPI site it returns nothing. Any ideas of what else I could try to make this work? from seleniumwire import webdriver # Import from seleniumwire # Create a new instance of the Chrome driver driver = webdriver.Chrome() # Go to the Google home page driver.get(“https://www.google.com”) # Access 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”], ) submitted by /u/frocketgaming [link] [comments] 

I’m attempting to intercept network activity on a website to get the json response I see in the ‘Preview’ tab of Chrome.

After some looking I’ve landed on Selenium Wire but even doing the example from the PyPI site it returns nothing. Any ideas of what else I could try to make this work?

from seleniumwire import webdriver # Import from seleniumwire # Create a new instance of the Chrome driver driver = webdriver.Chrome() # Go to the Google home page driver.get("https://www.google.com") # Access 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"], ) 

submitted by /u/frocketgaming
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *