INNER CODE UNIT · Python

get_resp

jlopp/lopp.net · check_links.py:126

        async def get_resp(session, url):
            try:
                async with session.get(url) as response:
                    print(url)
                    if response.status != 200:
                        failed_links.append(url)
                    await response.text()
            except Exception as e:
                print(e)
                failed_links.append(url)

        async def download_links():
            timeout = aiohttp.ClientTimeout(total=10)

            async with aiohttp.ClientSession(
                headers=headers, timeout=timeout
            ) as session:
                tasks = []

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…