Replace ethernet shield with wifi shield

Good evening
I would like to make a project where Arduino reads txt file on a server.
I found in the forum a guide (Using Ethernet Shield to read text from a web page - Programming Questions - Arduino Forum), but is used a ethernet shield.
This guide (and in general all the guides that refer to Ethernet shield) also work with wifi shield?
Even with the cheapest (ESP8266)?
Thank you

ps: sorry for my bad english;-)

I would like to make a project where Arduino reads txt file on a server.

The Arduino can't do that. The Arduino could make a GET request to the server, and the script in the GET request could read the file and send the data in the reply to the Arduino.

The Ethernet shield communicates with the router using a wire. The WiFi shield communicates with the router using radio waves. The data sent from the Arduino to the router, and from the router to the Arduino is exactly the same.

Now, there are differences between the code needed with an Ethernet shield and the code needed with a WiFi shield, but the differences involve getting connected to the router (automatically in the ethernet shield case; not automatic in the wireless case).