how do i see the url my computer is currently hitting?
I am on Mac OSX. I wrote a program to parse a few websites. The websites are being accessed using curl. How can I view whi开发者_C百科ch url my computer is currently hitting?
If it's being called from your program, I'd add something to that program to print each website before running curl
. You can tell curl
to print the URL it's fetched with something like this:
curl -w "%{url_effective}\n" -o "$outputfile" "$url"
... but that won't print the URL until after it finishes downloading it. Also, note that this prints the effective URL to stdout; if the content of the web page is also going to stdout, they'll just get mixed together; you should only use this with -o
or -O
to redirect the web content.
If all else fails, you could try Wireshark. Might be overkill, but then again if you're working with http it's a useful tool anyway.
精彩评论