2

Just doing a simple GET request to whatismyip.org, and I get a different IP everytime. If it visit the website in my browser, it's always the same. What's up with this? I'm just running node.js locally on my windows 7 machine. How is it possible that I'm using different IPs?

request('http://www.whatsmyip.org/', function (error, response, body) {
    if (!error && response.statusCode == 200) {
        res.render('index', {content:body;});
    }
});

I feel like http://www.whatsmyip.org knows it's an automated request and is trolling me. xD

4

2 に答える 2

1

Read the HTML comment right above the IP address:

<!--
Please DO NOT program a bot to use this site to grab your IPs. It kills my server and thats not nice.
Just get some cheap or free web hosting and make your own IP-only page to power your bot.
Then you won't even have to parse any html, just load the IP directly - better for everyone!!
-->
于 2012-11-11T03:52:43.773 に答える
1

It looks like the site is using JavaScript to update the span on the page, so if you're doing a simple HTTP request then that won't be updated to the correct value. If you go to the site with a Web browser but just view the source (not using any updated inspector) and refresh then the IP displayed appears to be random.

于 2012-11-11T03:57:51.357 に答える