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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:18:10+00:00 2026-06-13T01:18:10+00:00

I need a good page rendering library so that I can extract all links(including

  • 0

I need a good page rendering library so that I can extract all links(including anchor text, the underlying hyperlink, absolute position of the link on the page) from a web page.

I have been using the CSSBox library, however, the href attribute is missing from the rendered box model. In other words, I can only obtain anchor text and position of the link using CSSBox alone. I have to take advantage of the anchor text and another html parsing library(e.g.,Jsoup) to get the href attribute(i.e., the de facto URL).

Is there any library that can better achieve my goal?

  • 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-13T01:18:11+00:00Added an answer on June 13, 2026 at 1:18 am

    Recommendation

    Consider using Geb:

    It brings together the power of WebDriver, the elegance of jQuery
    content selection, the robustness of Page Object modelling and the
    expressiveness of the Groovy language.

    It can be used for scripting, scraping and general automation — or
    equally as a functional/web/acceptance testing solution via
    integration with testing frameworks such as Spock, JUnit & TestNG.

    Requirements

    As mentioned, this is only suitable if you are open to the use of Groovy. However, since Groovy integrates so easily with Java, this typically isn’t a problem.

    Furthermore, this will require a browser. I’m not sure if this is a deal breaker for you.

    Usage

    From the docs:

    You can obtain the size and location of content on the page. All units
    are in pixels. The size is available via the height and width
    properties, while the location is available as the x and y properties
    which represent the distance from the top left of the page (or parent
    frame) to the top left point of the content.

    For example:

    Browser.drive {
      // Load the page
      go "http://myapp.com"
    
      // $("a") returns all hyperlinks on the page, similar to jQuery
      $("a").each { a ->
         // Display the required link properties and attributes
         println """
            The link to '${a.@href}' with text '${a.text()}' is at location (${a.x}, ${a.y}),
            with a height of ${a.height}px and a width of ${a.width}px.
         """
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to track ALL elements that are clicked on a HTML-page. I need
I need to do keyword search in Loaded web page. Is there any good
I need a good looking form for the home page to get users signed
I need a good variable name for a boolean value that returns false when
I can't use JQuery sadly I need to use good old Javascript. I have
I need a dropdown list on my page that will allow a user to
I need a good OLEDate java implementation, and this one does not seem to
I am in desperate need of good tutorials on Content Providers in Android. I
I'm working on a RESTful web service in Java. I need a good way
I need to find good way of embedding audio files on a website. I

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.