title: "Exception in thread "main" java.Lang.NullPointerException" Error
body: <p>I am trying to run a web scraper in Eclipse that, using Jsoup, that can take the names of the professors on this page: yu.edu/faculty and print them out. This is my code: </p>
  
  <pre><code>import java.io.IOException;
  
  import org.jsoup.Jsoup;
  import org.jsoup.nodes.Document;
  import org.jsoup.nodes.Element;
  import org.jsoup.select.Elements;
  
  public class YUscraper {
  
      public static void main(String[] args) throws IOException {
  
          // fetches &amp; parses HTML        
          String url = "http://yu.edu/faculty/";
          Document document = Jsoup.connect(url).get(); 
  
          // Extract data
          Element content = document.getElementById("mainlist");
          Elements names = content.getElementsByTag("a");
  
  
          // Output data
          for (Element name : names) {
              System.out.println("Name: " + name.text());
          }
      }
  
  }
  </code></pre>
  
  <p>I am getting this error: </p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
  at YUscraper.main(YUscraper.java:18)
  </code></pre>
  
  <p>I am relatively new to this so pardon me if I am missing something really evident. I used many examples I have seen to get to this point, but I still don't understand what throws IOException is for and what it means that an exception was found.  Please help, thanks!</p>