Reputation:
I am trying to measure the response time of a website but I am getting errors.
Script:
#!/usr/bin/python
import requests
time= requests.get("http://google.com").elapsed.total_seconds()
print time
Error:
Traceback (most recent call last):
File "./test.py", line 5, in <module>
time= requests.get("http://google.com").elapsed.total_seconds()
AttributeError: 'Response' object has no attribute 'elapsed'
Upvotes: 2
Views: 8219