Actually I'm working on a project about a smart socket, I need to request data from a web page which has a private IP adress. Should I use an Ethernet shield or a ESP8266 ? knowing that I want to access to the web page only from a local network , and I want to receive a whatsapp message as a kind of alert.
Did you read what I wrote about Whatsapp messages?
It's about a socket designed to send an alert in case of solar power insufficiency based on data requested from a web page.
What's the reason for that being a socket? And if you get all data on the internet and want to send the alert to the internet why the hell are you using an Arduino for that? That's about the most inefficient choice you could do.
I have a question about the get request through the google server , how can I do it using client.println() and the private IP adress ?
Again: no relation to the rest of the thread (where is the google server coming in?) and not enough context information to help you. You haven't posted any code but just write some method names here. Do you expect us to write your code? Forget that.
The Ethernet library includes an example named WebClient showing how to do HTTP GET. The ESP8266 Arduino board package includes HTTP GET examples in the folder named ESP8266HTTPClient.
I think both will work with private and Internet addresses.