cyrus-and / chrome-har-capturer

Capture HAR files from a Chrome instance
MIT License
530 stars 90 forks source link

Question: How to redirect the success/fail output to a file? #88

Closed jsw-zorro closed 3 years ago

jsw-zorro commented 3 years ago

I want to redirect the output like: - https://baidu.com/ ✓ to redirect to a file. Using chrome-har-capturer -f -k -p 9222 -o test.har $url | tee -a "./test.log" However, it seems the output will always be null. Is there anyway I can redirect the specific successful or failed information? Thanks for all the help.

cyrus-and commented 3 years ago

You want to redirect the standard error:

chrome-har-capturer -f -k -p 9222 -o test.har "$url" 2>>test.log
jsw-zorro commented 3 years ago

Thanks, previously I made a mistake in the standard error redirection and typed it wrong. So I mistakenly considered it will also not works. Thx!