We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, coders.
I am currently working on a project. I need to get new announcements from https://www.binance.com/en/support/announcement/new-cryptocurrency-listing?c=48 as soon as possible. I want to get new announcements within 1-2 seconds. The current codebase is implemented with Python Scrapping.
URL = https://www.binance.com/en/support/announcement/new-cryptocurrency-listing?c=48 async def fetch_with_retry(url: str, method: str = 'GET', max_retries: int = 1, **kwargs) -> Optional[str]: start_time = time.time() async with aiohttp.ClientSession() as session: for attempt in range(max_retries): try: async with session.request(method, url, **kwargs) as response: response.raise_for_status() text = await response.text() return text except aiohttp.ClientError as e: if attempt == max_retries - 1: return None await asyncio.sleep(2 ** attempt) # Exponential backoff return None async def fetch_announcements(self) -> Optional[str]: response = await self.fetch_with_retry( f"http://api.scrape.do/?token={API_KEY}&url={URL}", GET_MODE, headers=HEADERS ) if response: return response return None
But it takes 10 seconds.
I have two questions:
Is it possible to get new announcements using API instead of scraping?
How can I reduce the time by using scraping?
I hope hear from you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, coders.
I am currently working on a project.
I need to get new announcements from https://www.binance.com/en/support/announcement/new-cryptocurrency-listing?c=48 as soon as possible.
I want to get new announcements within 1-2 seconds.
The current codebase is implemented with Python Scrapping.
But it takes 10 seconds.
I have two questions:
Is it possible to get new announcements using API instead of scraping?
How can I reduce the time by using scraping?
I hope hear from you.
The text was updated successfully, but these errors were encountered: