Skip to content Skip to sidebar Skip to footer

How To Get Ip Address From Aiohttp Response

I am have been trying to look into responses from aiohttp requests and have not found a way to get the ipaddress of the specified host: async with aiohttp.ClientSession() as sessio

Solution 1:

I assume your host is represented by a url (otherwise you already have the IP)

So what you need to do is get an ip address by url. You can do this by:

import socket
print socket.gethostbyname('your hosto name')

your host name is probably 'http://{host}'

Post a Comment for "How To Get Ip Address From Aiohttp Response"