title: how do i click a hyperlink on a webpage using java without having the page open in browser
body: <p><strong>so im trying to make a file downloader that will download files based on what a hyperlink says or is called how would i go about clicking a hyperlink in java?</strong></p>
  
  <p>im trying to find the easiest way to do this with out opening a webpage. </p>
  
  <p><em>also im trying to do this with no java script because i do not control the site i only want to download from it.</em></p>
  
  <p>this is something i have been trying but i keep getting ERROR 403. how do i fix this? </p>
  
  <p>NOTE: <em>this does use the JSoup library.</em></p>
  
  <pre><code>Document doc = Jsoup.parse(new URL(yourURLhere), 2000);
  
      Elements resultLinks = doc.select("a");
      System.out.println("number of links: " + resultLinks.size());
      for (Element link1 : resultLinks) {
          System.out.println();
          String href = link1.attr("href");
          System.out.println("Title: " + link1.text());
          System.out.println("Url: " + href);
      }
  </code></pre>