How to see API call of websites in Chrome using Python? Alternatively, for a slightly more conversational to

22 Replies, 1925 Views

Selenium isn’t overkill if you’re already familiar with it! Just enable HAR logging:

```python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.set_capability('goog:loggingPrefs', {'performance': 'ALL'})
driver = webdriver.Chrome(options=options)
driver.get("https://example.com")

logs = driver.get_log('performance')
print(logs)
```
This dumps all network activity, including API calls.

Messages In This Thread



Users browsing this thread: 1 Guest(s)