S
S
Sanya Hihi Haha2020-06-15 20:16:45
Python
Sanya Hihi Haha, 2020-06-15 20:16:45

How to organize multithreading with requests?

Good
In general, even I can’t finish one moment.
There is a small python-requests program, I

sort through a bunch of id-shnikov and follow the links
example:

def Parse():
    link = "site.ru/index.php?id="
    id_list = [1,2,3,4,5,6,7,8,9,10] # до миллиона

    for i in id_list :
        print(i)
        src = requests.get(link + "&sstr=&sstr_id={}".format(i))

Now requests in one thread go one after another
. What would you like? - send 50 requests at once using links with a substituted id
Thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alons, 2020-06-15
@ValarMayar

https://www.thepythoncode.com/article/using-thread...
Here you have the answer to your question and theory and practice and do not thank...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question