Using Ethernet Shield to Connect to Wifi

Hi, I am trying to connect the Ethernet shield to my network wifi to then pull data from a website to display on an lcd screen.

I used this code from Arduino on setting up wifi: https://www.arduino.cc/en/Guide/ArduinoWiFiShield#toc1

#include <WiFi.h>

char ssid[] = "yourNetwork";     // the name of your network
int status = WL_IDLE_STATUS;     // the Wifi radio's status

void setup() {
  // initialize serial:
  Serial.begin(9600);

  // attempt to connect to an open network:
  Serial.println("Attempting to connect to open network...");
  status = WiFi.begin(ssid);

  // if you're not connected, stop here:
  if ( status != WL_CONNECTED) { 
    Serial.println("Couldn't get a wifi connection");
    while(true);
  } 
  // if you are connected :
  else {
      Serial.print("Connected to the network");
  }
}

void loop() {
  // do nothing
}

But then Serial Monitor said there were no networks available, when my computer is currently connected to my university wifi and I have a cellular hotspot I could connect to. Any troubleshooting ideas?

Ethernet shield to WiFi? Ethernet shield is for cable.
so what shield do you really have?

This is the brand and maker of the shield: SunFounder Ethernet Shield W5100 for Arduino UNO R3 Mega 2560 1280 A05

Features
1.With this Ethernet Shield, your Arduino board can be used to connect to internet.
2.Can be used as server or client.
3.Directly plug puzzle board, no soldering required.
4.Controller: w5100.
5.This is the latest version of the Ethernet Shield.
6.This Arduino Ethernet Shield which is based on the Wiznet W5100 Ethernet Chip gives you an easy way to get your Arduino Online.
7.It is directly supported by Arduino official Ethernet Library.
8.It adds a micro-SD card slot, which can be used to store files for serving over the network.
9.It is compatible with the Arduino Duemilanove (168 or 328), Uno as well as Mega (1280/2560) and can be accessed using the SD library.
10.The Wiznet W5100 provides a network (IP) stack capable of both TCP and UDP.
11.It supports up to four simultaneous socket connections.
12.Use the Ethernet library to write sketches which connect to the internet using the shield.
13.Fits all version of arduino Main board,2009,UNO, mega 1280, mega 2560.
14.Size:7cm x 5.4cm x 2.4cm - 2.76inch x 2.12inch x 0.94inch.

so, then take an Ethernet cable, connect the shield to the router/switch and use the Ethernet library.

WiFi is wireless network

The serial monitor is displaying "no networks can be found" and "no wifi connection" after I run the code.

I also want to have a free-standing prototype. After I connect the wifi does it have to stay plugged into the computer or after the information is inputted in the code it will be able to connect?

Newbie204:
The serial monitor is displaying "no networks can be found" and "no wifi connection" after I run the code.

I also want to have a free-standing prototype. After I connect the wifi does it have to stay plugged into the computer or after the information is inputted in the code it will be able to connect?

use the Ethernet library, not the WiFi library.

there is nothing wireless on that shield.
you can connect it to WiFi network only with a WiFi bridge

WiFi code does not work on Ethernet shields. See the following for Arduino Ethernet details including Ethernet examples.