Here you can find the source of verifyAdultNotice(Document doc)
public static Document verifyAdultNotice(Document doc) throws IOException
//package com.java2s; /*// ww w . jav a 2 s . com * Copyright 2009-2012 TauNova (http://taunova.com). All rights reserved. * * This file is subject to the terms and conditions defined in * file 'LICENSE.txt', which is part of this source code package. */ import java.io.IOException; import java.util.Iterator; import org.jsoup.Connection; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; public class Main { private static final String ADULT_NOTICE = "Adult Content Notice"; public static Document verifyAdultNotice(Document doc) throws IOException { Document document = doc; if (ADULT_NOTICE.equals(doc.title())) { Element form = document.select("form[action~=adult_\\w+.bml$]") .first(); Element hidden = form.select("input[name=ret]").first(); Element submit = form.select("input[name=adult_check]").first(); Connection conn = Jsoup.connect(form.attr("action")); Iterator<Element> iterator = form.select("input").iterator(); while (iterator.hasNext()) { Element element = iterator.next(); //System.out.println(" -- " + element.attributes()); conn = conn.data(element.attr("name"), element.attr("value")); } document = conn.post(); } return document; } }