I am using Jsoup library to read the content inside website using it's link, specifically the data from selected text on this image of site inspection: image I tried with no success,i don't understand which section or classes need to fetch in my code.
import java.io.*;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class ReadingWebPage {
// Main method
public static void main(String[] args) {
try {
// Here i create a document object and use JSoup to fetch the website
Document doc = Jsoup.connect("https://efiskalizimi-app.tatime.gov.al/invoice-check/#/verify?iic=458B743C9A4B6252CD895077308A642A&tin=K22305002U&crtd=2023-08-25T08:39:31%2002:00&ord=747371&bu=nd748hb825&cr=qc431mv163&sw=sc782sw243&prc=16711.00")
.userAgent("Mozila/117.0")
.get();
System.out.printf("Title: %s\n",doc.title());
// the list of repositories
Elements repositories = doc.getElementsByClass("invoice-items");
for (Element repository : repositories) {
String repositoryTitle = repository.data();
String repositoryIssues = repository.getAllElements().text();
String repositoryDescription = repository.getElementsByClass("invoice-item--price").text();
String repositoryGithubName = repository.getElementsByClass("invoice-item--details").text();
String repositoryGithubLink = "https://github.com/" + repositoryGithubName.replaceAll("[()]", "");
System.out.println("\t" + repositoryDescription);
System.out.println("\t" + repositoryTitle);
System.out.println("\n");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
I plan to use it in a delivery software project. I just need a small example that works. Can someone help please?