java - jsoup : Absolute path while working with files -
i got page repository html files. want process them using jsoup, when try absoloute paths of links jsoup gave me empty strings (""). there possiblity set baseuri file path ?
solution : link.get(i).baseuri + link.get(i).attr("href") not sufficient me becouse need how recognize link relative or not.
the jsoup documentation says :
there sister method parse(file in, string charsetname) uses file's location baseuri. useful if working on filesystem-local site , relative links points on filesystem.
but doesn't work on pc.
you can use absurl()-function in jsoup elements.
string path = linkel.absurl("href");
Comments
Post a Comment