I was messing around with Pyth's url request feature, and noticed that google always gave a response with a slightly different length for me, usually ~10500
characters.
So your task in this challenge is to print out the average length of the html response from http://google.com
.
Specs
- You will take an input
n
which is the number of requests to make. - For each request, you will make an HTTP get request.
- You will count the response body (the html text), not the headers.
- Output the arithmetic mean of the lengths of the responses.
- You can only access the url
http://google.com
, not any other. - This is code-golf, so shortest code in bytes wins!
Sample output for input 10
: 10560.1
(I used Python's urllib
for that)
P.S: does anyone know why google does this?
http://google.com
always returns 261 bytes for me...https://google.com/ncr
might return more though. \$\endgroup\$http://google.com
always returns 10422 bytes for me... \$\endgroup\$http://google.com
sends. Of course this isn't the point of the challenge, so the challenge should IMO be edited to reflect that. \$\endgroup\$