Reputation: 1259
I want to find my public ip adress from python program.
So far this is the only site
http://www.whatismyip.com/ and http://whatismyip.org/
which gives ip without proxy rest all give the proxy.
Now .org site is using image and first one writes ip across many span elements so i can't grab with urllib.
Any other idea or site so that i can get my ip
Upvotes: 1
Views: 1401
Reputation: 298196
I usually use http://httpbin.org/:
import requests
ip = requests.get('http://httpbin.org/ip').json()['origin']
Upvotes: 6