How to find your Public-facing IP with Python, requests and BeautifulSoup

In this entry, we’re going to look up what our public facing IP address is, using the Python modules, re, requests and BeautifulSoup. It’s going to send a request to whatismyip.com with requests, then we’re going to parse the returned HTML in BeautifulSoup, so we can break it up, and navigate through it a lot easier, and then finally, use re to grab the IP address and print it to the screen.

Hit the jump for the tutorial!

Continue reading “How to find your Public-facing IP with Python, requests and BeautifulSoup”