質問

I am using urllib3 to query an online API over HTTP thousands of times (specifically, over 40,000) one after another.
I've noticed that in the beginning, the HTTP GET's from the API are really fast (< 500ms).
As more and more HTTP requests are being made, the response time slows down to the point of being a few seconds.

My code looks like this:

http = urllib3.PoolManager()
req = http.request(u'GET', URL)
doc = xml.dom.minidom.parseString(req.data)
nodes = doc.getElementsByTagName(ELEMENT_NAME)
for node in nodes:
    #process the node, this happens very very fast.

Am I missing anything? Thanks!

役に立ちましたか?

解決

Perhaps the API you're hitting is throttling you?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top