Skip to content
Advertisement

Tag: jsoup

How to save a Jsoup Document to an HTML file?

I have used this method to retrieve a webpage into an org.jsoup.nodes.Document object: myDoc = Jsoup.connect(myURL).ignoreContentType(true).get(); How should I write this object to a HTML file? The methods myDoc.html(), myDoc.text() and myDoc.toString() don’t output all elements of the document. Some information in a javascript element can be lost in parsing it. For example, “timestamp” in the source of an Instagram

How to connect via HTTPS using Jsoup?

It’s working fine over HTTP, but when I try and use an HTTPS source it throws the following exception: Here’s the relevant code: Answer If you want to do it the right way, and/or you need to deal with only one site, then you basically need to grab the SSL certificate of the website in question and import it in

jsoup posting and cookie

I’m trying to use jsoup to login to a site and then scrape information, I am running into in a problem, I can login successfully and create a Document from index.php but I cannot get other pages on the site. I know I need to set a cookie after I post and then load it when I’m trying to open

Advertisement