1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| // import java.io.IOException; // Import the IOException class to handle errors
import file from 'java.io.File';
import IOException from 'java.io.IOException';
import Jsoup from 'org.jsoup';
import Document from 'org.jsoup.nodes.Document';
import Element from 'org.jsoup.nodes.Element';
import parse from 'org.jsoup.parser';
window.addEventListener('load', function () {
console.log('Cette fonction est exécutée une fois quand la page est chargée.');
var urlPath = "https://site.fr/xxx/xxxx";
const url = new URL(urlPath);
Document doc = Jsoup.parse(url.openStream(), "UTF-8", urlPath);
Element res = doc.select("div.object").first();
// Print the result
System.out.println(res);
}
) |
Partager