Created
May 31, 2023 06:21
-
-
Save p3nj/56e22da8653d9785738bf75eca836268 to your computer and use it in GitHub Desktop.
Use geocoder to locate every ip in a list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geocoder | |
ip_addrs = ['172.10.10.10'] | |
if __name__ == "__main__": | |
for i in ip_addrs: | |
g = geocoder.ip(i) | |
print(g.country ,g.city, g.latlng) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment