Re: Html download challenge



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
>


.



Relevant Pages

  • Re: Is CALLBACK or WINAPI is necessary?
    ... >Everybody just talking, and talking, but YOU typed some sample code, Now, your code, is specific to the library, to make it ... Your own callbacks do not require any MS-specific qualifiers. ... is perfectly fine example of a callback routine. ... Microsoft MVP, Windows SDK ...
    (microsoft.public.vc.language)
  • Re: EndInvokeCalled
    ... Instead of polling like that, why not just pass a callback to ... >I came across the following sample code: ... > I am not using Forms and a tight loop still does not work. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Message loop (WndProc) in CommandBar?
    ... You have to set up a callback using the Win32 API's to handle what you want. ... You don't say what programming language you're using but I've done similar ... haven't done it for command bar button clicks but for things like setting up ... (Sample code would be much appreciated. ...
    (microsoft.public.outlook.program_addins)
  • Re: C ext / threading / callback issue, ruby-1.9.1p129
    ... got similar MRI crashes and/or stuck threads. ... invocation inside rb_thread_blocking_region, ... necessary for this sample code. ... Does the callback use ruby code from within the thread blocking region? ...
    (comp.lang.ruby)
  • Will Async Callback hander code ever be called if server offline?
    ... In the sample code that follows, "LongProcessCallbackHandler" is the name of the Async Callback hander code. ... AsyncCallback delCB = new AsyncCallback; ...
    (microsoft.public.dotnet.framework.remoting)