Multiple URLs copy in Sources/Network tab

前端 未结 2 549
旧时难觅i
旧时难觅i 2020-11-30 03:29

Is it possible to extract multiple resources\' URLs in Sources or Network tab of Chrome Dev Tools?
When I want to get URL of a single resource, I can do

相关标签:
2条回答
  • 2020-11-30 03:50
    1. make sure Network panel is active
    2. switch devtools Dock side in the menu to a detached (floating) window

      Next time you can press CtrlShiftD to toggle docking.


    1. in the now detached devtools press CtrlShifti or i on MacOS,
      which will open devtools-on-devtools in a new window

    1. Run the following code in this new window:

      copy(UI.panels.network._networkLogView._dataGrid._rootNode._flatNodes.map(n => n._request._url).join('\n'))

      It'll copy the URLs of all requests that match current filter to clipboard.


    Hint: save the code as a Snippet and run it in devtools-on-devtools window via the commands palette, CtrlP or P then type the snippet's name.


    A variant of the above code that also displays the URLs in the console:

    var URLs = UI.panels.network._networkLogView._dataGrid._rootNode._flatNodes
      .map(n => n._request._url);
    copy(URLs.join('\n'));
    URLs; // displays it in the console as an expandable array
    
    0 讨论(0)
  • 2020-11-30 03:50

    I found the above method too clunky, its way easier to use fiddler:

    • open fiddler (possibly install it)
    • filter on the domain name that you are interested in
    • clear the screen
    • refresh the web page
    • Select the fiddler output
    • right click and select copy just the URL's
    0 讨论(0)
提交回复
热议问题