// Path: app/src/main/java/org/pquery/webdriver/FailurePermanentException.java
// public class FailurePermanentException extends Exception {
// 
//     private static final long serialVersionUID = 7687740322490670417L;
// 
//     public String error;
//     public String details;
// 
//     public FailurePermanentException(String error) {
//         super(error);
//         this.error = error;
//     }
// 
//     public FailurePermanentException(String error, String details) {
//         super(error);
//         this.error = error;
//         this.details = details;
//     }
// 
//     public FailurePermanentException(String error, Exception details) {
//         super(error, details);
//         this.error = error;
//         this.details = details.getMessage();
//     }
// 
//     @Override
//     public String toString() {
//         String ret = error;
//         if (details != null)
//             ret += " [" + details + "]";
//         return ret;
//     }
// 
//     public String toHTML() {
//         String ret = error;
//         if (details != null)
//             ret += "<font color=red><small><br>[" + details + "]</small></font>";
//         return ret;
//     }
// 
// }


import android.content.res.Resources;
import org.pquery.R;
import org.pquery.webdriver.FailurePermanentException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

package org.pquery.webdriver.parser;




/**
 * Parser the message we get back after pq creation. It appears at top of
 * creation page in reponse to the creation POST
 * <p/>
 * There are some examples in different languages
 * <p/>
 * <p class="Success">
 * Thanks! Your pocket query has been saved and currently results in 10 caches.
 * You can <a href=
 * "http://www.geocaching.com/seek/nearest.aspx?pq=dd2e3f12-2c04-4090-bd1b-4e601f521fe5"
 * title="Preview the Search">preview the search</a> on the nearest cache page.
 * <p/>
 * <p class="Success">
 * Merci ! Votre pocket query a �t� modifi� et comprend pr�sentement 10 caches.
 * Vous pouvez <a href=
 * "http://www.geocaching.com/seek/nearest.aspx?pq=692a0d6f-1494-4ba6-9ac9-5877aff7e6b4"
 * title="Pr�visualiser la recherche">pr�visualiser la recherche</a> sur la page
 * de caches la plus pr�s.
 * </p>
 */
public class SuccessMessageParser {

    private String successMessage;
    private Resources res;

    /**
     * Try to parse out success message from passed in html
     * <p/>
     * Extracts out everything between <p class="Success"> and </p>
     */

// Path: app/src/main/java/org/pquery/webdriver/FailurePermanentException.java
// public class FailurePermanentException extends Exception {
// 
//     private static final long serialVersionUID = 7687740322490670417L;
// 
//     public String error;
//     public String details;
// 
//     public FailurePermanentException(String error) {
//         super(error);
//         this.error = error;
//     }
// 
//     public FailurePermanentException(String error, String details) {
//         super(error);
//         this.error = error;
//         this.details = details;
//     }
// 
//     public FailurePermanentException(String error, Exception details) {
//         super(error, details);
//         this.error = error;
//         this.details = details.getMessage();
//     }
// 
//     @Override
//     public String toString() {
//         String ret = error;
//         if (details != null)
//             ret += " [" + details + "]";
//         return ret;
//     }
// 
//     public String toHTML() {
//         String ret = error;
//         if (details != null)
//             ret += "<font color=red><small><br>[" + details + "]</small></font>";
//         return ret;
//     }
// 
// }


// Path: app/src/main/java/org/pquery/webdriver/parser/SuccessMessageParser.java
import android.content.res.Resources;
import org.pquery.R;
import org.pquery.webdriver.FailurePermanentException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

package org.pquery.webdriver.parser;




/**
 * Parser the message we get back after pq creation. It appears at top of
 * creation page in reponse to the creation POST
 * <p/>
 * There are some examples in different languages
 * <p/>
 * <p class="Success">
 * Thanks! Your pocket query has been saved and currently results in 10 caches.
 * You can <a href=
 * "http://www.geocaching.com/seek/nearest.aspx?pq=dd2e3f12-2c04-4090-bd1b-4e601f521fe5"
 * title="Preview the Search">preview the search</a> on the nearest cache page.
 * <p/>
 * <p class="Success">
 * Merci ! Votre pocket query a �t� modifi� et comprend pr�sentement 10 caches.
 * Vous pouvez <a href=
 * "http://www.geocaching.com/seek/nearest.aspx?pq=692a0d6f-1494-4ba6-9ac9-5877aff7e6b4"
 * title="Pr�visualiser la recherche">pr�visualiser la recherche</a> sur la page
 * de caches la plus pr�s.
 * </p>
 */
public class SuccessMessageParser {

    private String successMessage;
    private Resources res;

    /**
     * Try to parse out success message from passed in html
     * <p/>
     * Extracts out everything between <p class="Success"> and </p>
     */

    public SuccessMessageParser(String html, Resources res) throws FailurePermanentException {
