querry on queue ( thread safe ) multithreading

Jim Gibson jimsgibson at gmail.com
Tue Mar 11 13:18:37 EDT 2014


In article <de667c72-c1f7-449e-86cf-ce8c6818b87d at googlegroups.com>,
Jaiprakash Singh <jaiprakash at wisepromo.com> wrote:

> hey i am working on scraping a site , so  i am using multi-threading concept.
> i wrote a code based on queue (thread safe) but still my code block out after
> sometime, please help , i have searched a lot but unable to resolve it.
> please help i stuck here.

Do you really want to subject the web server to 150 simultaneous
requests? Some would consider that a denial-of-service attack.

When I scrape a site, and I have been doing that occasionally of late,
I put a 10-second sleep after each HTTP request. That makes my program
more considerate of other people's resources and a better web citizen.
It is also much easier to program.

-- 
Jim Gibson



More information about the Python-list mailing list