Instead of using a brittle method like parsing an HTML page you can also use any of the dozens of available API’s that provide your IP-address in JSON format:
Instead of using a brittle method like parsing an HTML page you can also use any of the dozens of available API’s that provide your IP-address in JSON format: