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 8898231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:33:41+00:00 2026-06-15T00:33:41+00:00

Can someone please give me a good tutorial on screen scraping. I have a

  • 0

Can someone please give me a good tutorial on screen scraping. I have a webpage that my university uses to upload all the data for each class. To get on to the home page for their site there is an entry screen which has a log in button. When pressed it brings up a floating dialog asking for user name and password. Then it goes straight to the homepage. I do not know where it is requesting for authorisation and i would like to be able to get data from the site programmatically. The data i require is through many more screens with logins but if i can get passed this first screen with my id and password I will be happy enough. preferably i would like this in java but any language will do

  • 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. Editorial Team
    Editorial Team
    2026-06-15T00:33:42+00:00Added an answer on June 15, 2026 at 12:33 am

    This sounds like the login dialog is not part of the original page, but constructed on the fly by some JavaScript, possibly through Ajax calls.

    What you will need is some sort of headless browser, that supports javaScript and Ajax.

    Have a look at HtmlUnit (http://htmlunit.sourceforge.net/), from the introduction:

    HtmlUnit is a “GUI-Less browser for Java programs”. It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc… just like you do in your “normal” browser.

    It has fairly good JavaScript support (which is constantly improving) and is able to work even with quite complex AJAX libraries, simulating either Firefox or Internet Explorer depending on the configuration you want to use.

    Edit: here is an example:

    I noticed that the page you want to scan (http://qub.ac.uk/qol/) uses basic authentication, so it is not some kind of HTML input form that pops up, but a browser dialog. When you press the ‘Login’ button on the start page, a page https://qub.ac.uk/qol/ will be loaded, which is secured in that way.

    For a test, I only show you how to get the heading from the unsecured http://qub.ac.uk/qol/ page using HtmlUnit, because I have no access to the secret parts, of course.

    I think, it should be clear how it works in general. Consult the excellent documentation and other resources on the web for more details on how to use the HtmlUnit API.

    package test;
    
    import java.io.IOException;
    import java.net.MalformedURLException;
    
    import javax.xml.bind.DatatypeConverter;
    
    import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
    import com.gargoylesoftware.htmlunit.WebClient;
    import com.gargoylesoftware.htmlunit.html.DomElement;
    import com.gargoylesoftware.htmlunit.html.DomNodeList;
    import com.gargoylesoftware.htmlunit.html.HtmlPage;
    
    public class Scraper {
    
        public static void main(String[] args)
                throws FailingHttpStatusCodeException, MalformedURLException,
                IOException {
            WebClient webClient = new WebClient();
    
            String username = "user";
            String password = "pw";
            String authString = username + ":" + password;
            String authEncoded = DatatypeConverter.printBase64Binary(authString
                    .getBytes());
    
            webClient.addRequestHeader("Authorization", "Basic " + authEncoded);
    
            HtmlPage page = webClient.getPage("http://qub.ac.uk/qol/");
            // System.out.println(page.asXml());
            DomNodeList<DomElement> headings = page.getElementsByTagName("h3");
            for (DomElement e : headings) {
                System.out.println("Got heading: " + e.getTextContent());
            }
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can someone please give me a hint, how I can convert any that a
Can someone please give me a recursive command that will go through a directory
Can someone please give regular expression for a word, which should have: length in
Can someone please give me quick tutorial about how to achieve GZIP using apache
can someone please give me an example on the internet of how the system
Can someone please give me an idea of how the WIRED Magazine on iPad
What is the difference? Are these the same? If not, can someone please give
Can someone give me a simple example involving threads in this manner, please. Problem
Can someone please tell me what this means: 07-04 09:54:38.048: I/DetailActivity(15496): Title that is
Can someone please give an example of how to use the HashMap forall() method?

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.