I need to check the status code of a request with Jsoup and if 200 go to parse html.
If I use this:
dom = jSoupClass.connect( "http://www.google.it" )
.userAgent("Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
.execute();
status = dom.statusCode();
I will get the response status code, but how can I then parse the html?
Just call
parse()on the response likeDocument doc = dom.parse()should do.