Project description
Asyncrequester is a library that makes it easy to make async requests with grequests library.
Install
pip install asyncrequester
Quick start
from asyncrequester import get_async_requests,get_single_request
headers = {
'authority': 'www.google.com',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'sec-fetch-site': 'none',
'sec-fetch-mode': 'navigate',
'sec-fetch-dest': 'document',
'accept-language': 'en'
}
urls = ["https://www.google.com"]*100
responses = get_async_requests(urls,20,0.5,headers)
# it will make 20 requests every 0.5 seconds and return all responses
# 'headers' is optional
response = get_single_request(urls[0])
# it makes simple get request
Output
Total web page count: 100
0 Waiting
20 Waiting
40 Waiting
60 Waiting
80 Waiting
100 Waiting
Succes: 100 , Fail: 0
It took 7.0120155811309814 seconds to retrieve 100 webpages.
Parameters
- urls: url list
- max_connections: max connections at once
- time_delay: delay for every request
- headers: headers (Optinal)
Metadata
Release files for asyncrequester 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asyncrequester-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Release files / asyncrequester-0.1.3-py3-none-any.whl
| Download URL | asyncrequester-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e8dd1b9121584f4c4190cfed3a03222752e0477b5c186e90603ce29d8ae5087
|
|
BLAKE2b-256 checksum How to use checksums |
3e05c19a753829d6dddc709f7237258249a0543869869c05af4a1c3d7c328a0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.9
|