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

  • SEARCH
  • Home
  • 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 67k
  • Answers 67k
  • 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
  • added an answer When it comes to reviewing banking systems and similar piece… May 11, 2026 at 11:53 am
  • added an answer according to msdn linkt private void txtShortcut_KeyDown(object sender, KeyEventArgs e)… May 11, 2026 at 11:53 am
  • added an answer Looks like there is no straight forward way to do… May 11, 2026 at 11:53 am

Related Questions

I would like to use java to get the source of a website (secure)
I have a Perl module that I would like to use from Java. Is
I would like to use a language that I am familiar with - Java,
Is there an openID implementation in Java? I would like to use this in
I would like to use something like CLR Profiles on .Net 2.0 to see
I would like to use as and is as members of an enumeration. I
I would like to use a component that exposes the datasource property, but instead
I would like to use client-side Javascript to perform a DNS lookup (hostname to
I would like to use javascript to develop general-purpose GUI applications. Initially these are
I would like to use my laptop as a web development (PHP, Python, etc.)

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.