public void parser() throws Exception {/*
* parser per estrapolare dal codice
* html del url specificato i soli
* tag 'href' che identificano i
* collegamenti
*/
String sourceUrlString = "http://www.agenziadogane.it/wps/wcm/connect/ed";
String sito = " http://www.agenziadogane.it";
Source source = new Source(new URL(sourceUrlString));
// invia un messaggio se c'è stato un errore di indicizzazione sito
source.setLogWriter(new OutputStreamWriter(System.err));

source.fullSequentialParse();

FileOutputStream file = new FileOutputStream(
"C:/wamp/www/Temp/href.txt");
PrintStream Output = new PrintStream(file);

List linkElements = source.findAllElements(HTMLElementName.A);
for (Iterator i = linkElements.iterator(); i.hasNext() {
Element linkElement = (Element) i.next();
String href = linkElement.getAttributeValue("href");
if (href == null)
continue;

String label = linkElement.getContent().extractText();
Output.println(href + " (" + label + ")");
}/* fine for */


questo è il mio parser che salva su un file solo gli href.
di seguito ti riporto la classe proxy che vorrei integrare con il mio parser ma questo non riesco a farlo:


public class URLReader {
public static void main(String[] args) throws Exception {
// Configure proxy ...
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "192.168.1.253");
System.setProperty("http.proxyPort", "8080");
// System.setProperty("http.proxyType", "4");
String proxyUser = "S2828181",
proxyPassword = "9997NCE7";

// Open URL ...
URL url = new URL("http://www.agenziadogane.it/wps/wcm/connect/ed/");
URLConnection con = url.openConnection();

//proxy user and pass
con.setRequestProperty(
"Proxy-Authorization",
"Basic " + new sun.misc.BASE64Encoder().encode(
(proxyUser + ":" + proxyPassword).getBytes()
)
);

BufferedReader in = new BufferedReader (
new InputStreamReader (
con.getInputStream ()
)
);


In "in" ho tutto il codice html del sito

Puoi aiutarmi??? Grazie....