I'm trying to get a json of all the past network entries from a streaming website. Here's a screenshot of where I see those network entries:
Once you press the play button, the website loads .acc files (like .mp3) over a period of time, approximately every 11 seconds. I'm running a script to get all the entries (it's a list of dicts) specified by script =
. This script eventually stops updating at 250 entries, even though there continue to be .acc files loaded into the page. This expresses itself as print(current==last)
eventually printing True
. I don't know why the getEntries
is not recognizing the items loaded past 250. Help me out?
Code:
script = "var performance = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {}; var network = performance.getEntries() || {}; return network;"
url = 'https://www.iheart.com/live/kiss-108-1097/'
options = Options()
driver = webdriver.Firefox(options=options)
driver.get(url)
last= 0
for i in range(100):
time.sleep(11)
current = driver.execute_script(script)
print(current==last)
last=current