0

I'm using puppeteer to automatize spotify login and tracks search and play from a node cli script. since I'm intercepting requests, I want to log only the urls like the one above

https://audio-akp-quic-control-spotify-com.akamaized.net/audio/cb8daa71ccc075db7c559871bdc4?__token__=exp=1614258319~hmac=30c6d8c5676fb472ec33fd5c8ca6331ee756daf9f69096e214

Usually in a chrome extension I can use a glob to target only the desired url for example: https://audio-akp-quic-control-spotify-com.akamaized.net/audio/*, how I can achive the same result in node and log only the request / responses from the urls I need?

newbiedev
  • 2,607
  • 3
  • 17
  • 65
  • 1
    Check the example given in official docs for [page.setRequestInterception](https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagesetrequestinterceptionvalue). It shows how to intercept requests based on request URL. This should get you started. – yeniv Feb 24 '21 at 15:27
  • 1
    @ggorlen thank you, I'm looking at the solutions provided in the question you've linked. – newbiedev Feb 26 '21 at 17:01

0 Answers0