All Questions
29 questions
0
votes
0
answers
105
views
Python request get Invalid param error when using data from websocket result
token_info_list = []
list_lock = threading.Lock()
async def subscribe():
global token_info_list
async with websockets.connect(pump_new_pair_url) as ws:
# Subscribing to token creation ...
0
votes
1
answer
242
views
Adding a timeout to an asyncio aiohttp
I am currently using the following code to query an api for data
import asyncio
async def get_data(session, ticker):
while True:
try:
async with session.get(url=f'api.exec.com'...
0
votes
0
answers
398
views
How to create a progress bar with aiometer's run_all method?
I've been creating a pipeline from an API using httpx, asyncio and aiometer to limit the number of coroutines running at once.
I know that it's possible to create a async progress bar for asyncio's ...
0
votes
2
answers
613
views
How to add a try until success loop inside aiohttp requests
I have the following code,
import aiohttp
import asyncio
async def get_data(session, x):
try:
async with session.get(url=f'https://api.abc.com/{x}') as response:
data = await ...
0
votes
1
answer
329
views
Unable to get multiple response requests on aiohttp
I am trying to pull multiple responses requests using aiohttp but I am getting an attribute error.
My code looks like this, I had to obscure it because I am using a private api.
import aiohttp
import ...
-1
votes
1
answer
249
views
How to go through a list of API keys and repeat for each different request in url list?
import asyncio
import aiohttp
from time import perf_counter
import csv
path = "*******************"
domains = []
total_count=0
with open(path, 'r') as file:
csvreader = csv.reader(file)...
0
votes
1
answer
549
views
count successful and unsuccessful post requests for asynchronous post call/request
I need help in implementing the logic to count number of successful post calls which are asynchronous in nature (status_code=200) as well as failed_calls (status_code != 200)
I am new to coroutines. ...
3
votes
1
answer
1k
views
How to pass body into aiohttp get request?
How do I pass a body into aiohttp's get requests?
The code I have below is what I want to run asynchronously but im not able to get the same response -
using requests
request_accounts = requests.get(...
1
vote
1
answer
1k
views
How to avoid "too many requests" error with aiohttp
Here's a snippet of my parser code. It does 120 requests asynchronously. However, every response returns 429 "too many requests" error. How do I make it "slower", so the api won't ...
1
vote
0
answers
984
views
Difference between requests module and aiohttp/httpx module from Asyncio perspective
My question is what exactly makes requests module incompatible and httpx, aiohttp modules compatible with Asyncio framework behind the scene?
I'm familiar with Asynchronous concepts and how it works ...
2
votes
0
answers
781
views
How to paginate a request asyncronously in python?
I am trying to extract the data from a response, which contains a cursor token that when passed as a parameter to the request url, returns the next 100 results. The cursor token is a hash value. I ...
1
vote
1
answer
568
views
Asynchronous http requests takes the same time as the synchronous one
i'm trying to scrape a website using aiohttp and asyncio in python, but it takes the same amount of time doing it in the synchronous way.
This is the asynchronous code that i'm using:
base_url="...
0
votes
2
answers
2k
views
Saving gzip file from Async HTTP request with Python
I'm trying to save a bunch of gzip files from an API response in async. Basically, I'm getting an array with different URI's and I have to append these to a base URL in order to download the .gz file. ...
1
vote
2
answers
3k
views
How to run coroutine function when use sync_to_async in django?
I have add_event method that calls _post method as async using sync_to_async in django. but when I test the method inside of Django shell, it does not even run my async _post function and returns ...
0
votes
2
answers
1k
views
TypeError: '_SessionRequestContextManager' object is not iterable
From this tutorial for multiple asynchronous get requests I copied and ran the following code:
import asyncio
import aiohttp
def fetch_page(url, idx):
url = 'https://yahoo.com'
response = ...