public static void main(String[] args) throws InterruptedException, IOException {
		
        FirefoxProfile profile = Utils.createFireFoxProfile();
        profile.setPreference("browser.download.dir", download_dir.getPath());
        
        WebDriver driver = Utils.createFireFoxDriver(profile);
        
        Utils.openTvdb(driver, "Ų򥻸ƪ");
        driver.findElement(By.partialLinkText("C L t ")).click();
        driver.findElement(By.partialLinkText("Ų򥻸ƪ")).click();
        
        String mainWin = driver.getWindowHandle();
        String newWin = null;
        for(String hWnd : driver.getWindowHandles()) {
        	if(!hWnd.equals(mainWin)) {
        		newWin = hWnd;
        		break;
        	}
        }
        
        if(newWin == null) {
        	throw new NoSuchWindowException("Ų򥻸ƪ");
        }
        
        driver.close();
        driver.switchTo().window(newWin);
        mainWin = newWin;
        newWin = null;
        
        for(OutputType type: EnumSet.allOf(OutputType.class)) {
        	new File(output_dir, type.name+"/"+"F").mkdirs();
        	new File(output_dir, type.name+"/"+"ѤHU").mkdirs();
        	new File(output_dir, type.name+"/"+"@z").mkdirs();
        	new File(output_dir, type.name+"/"+"Ƨ~ά").mkdirs();
        }
        
        driver.findElement(By.partialLinkText("uFv")).click();
        downloadTables(driver, "F", EnumSet.allOf(OutputType.class));
        
        driver.findElement(By.partialLinkText("uM~v")).click();
        
        Select unit = new Select(driver.findElement(By.id("setUnits")));
        unit.selectByVisibleText("ѤHU");
        Thread.sleep(1000); //TODO use something more robust instead
        downloadTables(driver, "ѤHU", EnumSet.allOf(OutputType.class));

        unit = new Select(driver.findElement(By.id("setUnits")));
        unit.selectByVisibleText("@z");
        Thread.sleep(1000);
        downloadTables(driver, "@z", EnumSet.allOf(OutputType.class));

        unit = new Select(driver.findElement(By.id("setUnits")));
        unit.selectByVisibleText("Ƨ~ά");
        Thread.sleep(1000);
        downloadTables(driver, "Ƨ~ά", EnumSet.allOf(OutputType.class));
        
        ((JavascriptExecutor)driver).executeScript("alert('Done!')");
	}