0

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:

enter image description here

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
Ben Gardner
  • 121
  • 1
  • 13

1 Answers1

0

Apparently "getting the network requests via performance entries will only give the network requests at/up to page load and cannot poll for subsequent async/ajax calls" per the answer to https://stackoverflow.com/a/45859018/6158174. Using BrowserMob Proxy (https://github.com/lightbody/browsermob-proxy) instead

Ben Gardner
  • 121
  • 1
  • 13