Export all http requests on a specific page to txt

2019-06-19 00:30发布

I use SIEGE to test my web server performance. For a more realistic test the best way to go would be to have SIEGE hit the web page (website.com/our-company) and all static assets (.css, .js, .png, .jpg). Everything that you see on the firefox / chrome debbuing tools, except of course from resources loaded from external servers (cdn.facebook, apis.google.com).

I am running several tests so it is a pain to manually collect all asset urls. Is there a tool that I can use to load a web page and export the url for everything that was loaded?

This is firefox debugging. If I could export this to txt or csv, it would be perfect. enter image description here

I tried CURL on debian CLI but I am no experct. Any tool will help, it does't have to be a plugin of Firefox / Chrome.

Best regards.

7条回答
女痞
2楼-- · 2019-06-19 00:47

Here's a free command line application to convert HAR files to CSV. Hope it helps.

http://www.yamamoto.com.ar/blog/?p=201

EDIT: added the project to GitHub:

https://github.com/spcgh0st/HarTools

查看更多
时光不老,我们不散
3楼-- · 2019-06-19 00:49

On Windows you could use HttpWatch to do this with the free Basic Edition in IE or Firefox:

http://www.httpwatch.com/download/

The CSV export function will export the URLs and other fields to a CSV file.

** Disclaimer: This was posted by Simtec Limited the makers of HttpWatch **

查看更多
Viruses.
4楼-- · 2019-06-19 00:49

As you guys know, the HAR file format is a JSON file. So... I looked for a JSON to CSV converter and found this:

https://json-csv.com/

This worked for my HAR file that I got from GTmetrix.com. Enjoy!

查看更多
We Are One
5楼-- · 2019-06-19 00:50

Had the same requirement of exporting HAR files from Chrome DevTools or Firebug to do load testing with siege. Additionally, I wanted to replay POST requests too.

Choose one of these solutions:

查看更多
倾城 Initia
6楼-- · 2019-06-19 00:51

In Chrome you can export these data to a HAR file (it's JSON based) in one click. Go to "Network", right click and choose "Save as HAR with content".

Save as HAR with Content option in DevTools

查看更多
来,给爷笑一个
7楼-- · 2019-06-19 00:51

You can Export all Http requests from Chrome Developer console by going to the Network tab

  • select one of the requests in Network Tab
  • press Right Mouse Button
  • from PopUp menu select Copy -> Copy all as Har (Curl/Har/etc)
  • paste into file

enter image description here

查看更多
登录 后发表回答