Currently, I am developing a Link Validator tool designed to analyze and validate all links within a specific domain based on a given seed page. For instance, when analyzing http://www.example.com/, the tool should assess all links associated with example.com.
The tool is set up to handle four types of files:
- Content Pages
- Images
- CSS
- Javascript files
For Content Pages, Images, and Javascript Files, I am utilizing the JSOUP Library. However, I am facing a challenge with CSS files that contain external resources. Specifically, I need a method to extract URL references from selectors like
background-image : url('images.png');
border-image: url('border.png');
and then convert these URLs into absolute URLs. Unfortunately, it appears that the JSOUP library does not offer functionality for handling CSS Selectors and resolving their values as absolute URLs.
While manual string manipulation could be used to solve this issue, it would likely introduce errors. Therefore, I am exploring alternative built-in solutions.
I hope this clarifies my situation. Thank you for your assistance in advance.