Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 100689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:37:39+00:00 2026-05-11T00:37:39+00:00

I would like to use java to get the source of a website (secure)

  • 0

I would like to use java to get the source of a website (secure) and then parse that website for links that are in it. I have found how to connect to that url, but then how can i easily get just the source, preferraby as the DOM Document oso that I could easily get the info I want.

Or is there a better way to connect to https site, get the source (which I neet to do to get a table of data…its pretty simple) then those links are files i am going to download.

I wish it was FTP but these are files stored on my tivo (i want to programmatically download them to my computer(

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:37:39+00:00Added an answer on May 11, 2026 at 12:37 am

    You can get low level and just request it with a socket. In java it looks like

    // Arg[0] = Hostname // Arg[1] = File like index.html public static void main(String[] args) throws Exception {     SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();      SSLSocket sslsock = (SSLSocket) factory.createSocket(args[0], 443);      SSLSession session = sslsock.getSession();     X509Certificate cert;     try {         cert = (X509Certificate) session.getPeerCertificates()[0];     } catch (SSLPeerUnverifiedException e) {         System.err.println(session.getPeerHost() + ' did not present a valid cert.');         return;     }      // Now use the secure socket just like a regular socket to read pages.     PrintWriter out = new PrintWriter(sslsock.getOutputStream());     out.write('GET ' + args[1] + ' HTTP/1.0\r\n\r\n');     out.flush();      BufferedReader in = new BufferedReader(new InputStreamReader(sslsock.getInputStream()));     String line;     String regExp = '.*<a href=\'(.*)\'>.*';     Pattern p = Pattern.compile( regExp, Pattern.CASE_INSENSITIVE );      while ((line = in.readLine()) != null) {         // Using Oscar's RegEx.         Matcher m = p.matcher( line );           if( m.matches() ) {             System.out.println( m.group(1) );         }     }      sslsock.close(); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 96k
  • Answers 97k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, your problem appears to be this: on the server… May 11, 2026 at 7:18 pm
  • Editorial Team
    Editorial Team added an answer Based on your code, the only thing you ought to… May 11, 2026 at 7:18 pm
  • Editorial Team
    Editorial Team added an answer A solution we have done commercially in the past is… May 11, 2026 at 7:18 pm

Related Questions

I have a Java program using AWT which I would like to run on
I would like to monitor the following system information in Java: Current CPU usage**
I have this legacy code base (Compaq PERL) , about 1500 lines of code,
I'm looking for any tools that can give you code churn metrics (graphs and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.