Re: Html download challenge
- From: "Paul Battersby" <batman42ca@xxxxxxxx>
- Date: Thu, 30 Jun 2005 14:05:04 -0400
And it seems we have a winner!
Adding this line:
System.setProperty("http.agent", "Test/1.0" + "(" +
System.getProperty("os.name") + ")");
to the sample code I posted previously, solves the problem.
THANKS!!!!!!!!
"Bill Tschumy" <bill@xxxxxxxxxxxxxxxxxxx> wrote in message
news:zqVwe.1242$U61.758@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> I have a product called Parsnips that uses Java to download URLs and index
> them. It works fine with the URL you gave.
>
> Here is the code snippet I use:
>
> System.setProperty("sun.net.client.defaultConnectTimeout",
> "10000");
> System.setProperty("sun.net.client.defaultReadTimeout", "10000");
> System.setProperty("http.agent", "Parsnips/" + Parsnips.CURRENT_VERSION +
"
> (" + System.getProperty("os.name") + ")");
>
> URL url = new URL(urlStr);
> BufferedReader urlReader = new BufferedReader(new
> InputStreamReader(url.openStream()));
> callback = new ParserCallback(url, null);
> new ParserDelegator().parse(urlReader, callback, true);
> urlReader.close();
>
> As I say, this is working for me. You will probably want to replace the
> ParserCalback stuff with some other way to read the URL stream.
>
> --
> Bill Tschumy
> Otherwise -- Austin, TX
> http://www.otherwise.com
>
.
- References:
- Html download challenge
- From: Paul Battersby
- Re: Html download challenge
- From: Tor Iver Wilhelmsen
- Re: Html download challenge
- From: Bill Tschumy
- Html download challenge
- Prev by Date: Re: Html download challenge
- Next by Date: Re: Defining a constructor in an Interface
- Previous by thread: Re: Html download challenge
- Next by thread: Re: Html download challenge
- Index(es):
Relevant Pages
|