}
public static String getBaseHref(String rawPage) throws IOException {
if (rawPage==null || !StringUtils.containsIgnoreCase(rawPage, "<base")) return null;
HtmlCleaner cleaner = new HtmlCleaner();
//CleanerProperties props = cleaner.getProperties();
//props.setXXX(...);
TagNode node = cleaner.clean(rawPage);
TagNode[] myNodes = node.getElementsByName("base", true);
if (myNodes==null || myNodes.length==0) return null;
String href = myNodes[0].getAttributeByName("href");
if (href!=null) return href;
return null;