HTML downloader and parser for CR
public static void main(String[] args) throws Exception {
    final String site1 = "http://codereview.stackexchange.com/questions/";
    String site2;
    String site3;


Why do define site1 as a final constant, but delay the other assignments until later? They should really be static finals for the class. Also some clearer names would not go amiss.

    URL url;


Declare them where they are used, don't declare them ahead of time.

    HtmlGetter htmlGetter = new HtmlGetter();

    while(true) {
        site2 = "69";
        site3 = "is-this-implementation-of-shamos-hoey-algorithm-ok";
        url = new URL(site1 + site2 + "/" + site3);
        htmlGetter.setFileName("[" + site2 + "]" + site3 + ".html");
        htmlGetter.download(url);
        htmlGetter.parse();
        break;


Why do you have a loop if you are just going to break out of it?
        }
    }

public void parse() throws Exception {


You shouldn't throw Exception, your specification should really only include the exceptions that'll actually be thrown

    Scanner scanner = new Scanner(new File(fileName));
    String oneLine;
    String htmlTagRegex = "&lt;(/)?([a-zA-Z]*)(\\s[a-zA-Z]*=[^&gt;]*)?(\\s)*(/)?&gt;";


Parsing HTML by regex is asking for trouble. Instead, you'll find the task much easier if you grab a html parsing library and use that. 

    while(scanner.hasNextLine()) {
        oneLine = scanner.nextLine();
        if(oneLine.matches(".*&lt;code&gt;.*")) {


You are just searching for a substring here, there isn't much point in using regex to do that.

            while(scanner.hasNextLine()&amp;&amp;(!oneLine.matches(".*&lt;/code&gt;.*"))) {


If you insist on regex, use a single regex to capture the entire code tag. 

                oneLine = StringEscapeUtils.unescapeHtml4(oneLine.replaceAll(htmlTagRegex, ""));
                System.out.println(oneLine);
                oneLine = scanner.nextLine();
                // This cannot handle such kind of a line which has &lt;code&gt; and &lt;/code&gt; together.
            }
            System.out.println("-------------------------------------------");
        }
    }           
}


Using something like jsoup: http://jsoup.org/

Document question = Jsoup.connect("http://codereview.stackexchange.com/questions/69").get();
Elements codes = question.select("code")
for(Element code: codes)
{
   System.out.println(code.text())
}