Re: Reading HTML (web) page through socket [message #59801] |
Thu, 10 April 2008 04:05 |
rhyme2ri2
Messages: 11 Registered: February 2008
|
Junior Member |
|
|
On Apr 10, 12:34 am, Jean H <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> rhyme2ri2 wrote:
>> Hello all,
>
>> I want to read an html(web) page. I am able to do this using socket
>> but the problem is that i don't know the size of the page. Is there
>> any possible way to know the size of page before reading it using
>> sockets. The size is needed as i need to allocate buffer on the basis
>> of this size.
>
>> Or, if there is a better way to read an html(web) page in idl then
>> please let me know.
>
>> Thanks & Regards
>> -Ritu
>
> If you have IDL 6.4 and up, you can use:
>
> url = 'http://www.google.com'
> ourl = obj_new('IDLnetURL')
> content = ourl->get(url=url, filename = outName)
> obj_destroy, ourl
>
> the whole page (and HTML code) is saved in the variable content, no
> matter what size it is!
>
> Jean
Yup....
I know abt that....but to my bad luck I'v to use IDL 6.3..
But then I got one routine named webget() which does the same
functionality..
Regards
-Ritu8
|
|
|
Re: Reading HTML (web) page through socket [message #59815 is a reply to message #59801] |
Wed, 09 April 2008 12:34  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
rhyme2ri2 wrote:
> Hello all,
>
> I want to read an html(web) page. I am able to do this using socket
> but the problem is that i don't know the size of the page. Is there
> any possible way to know the size of page before reading it using
> sockets. The size is needed as i need to allocate buffer on the basis
> of this size.
>
> Or, if there is a better way to read an html(web) page in idl then
> please let me know.
>
> Thanks & Regards
> -Ritu
If you have IDL 6.4 and up, you can use:
url = 'http://www.google.com'
ourl = obj_new('IDLnetURL')
content = ourl->get(url=url, filename = outName)
obj_destroy, ourl
the whole page (and HTML code) is saved in the variable content, no
matter what size it is!
Jean
|
|
|
Re: Reading HTML (web) page through socket [message #59816 is a reply to message #59815] |
Wed, 09 April 2008 12:30  |
rhyme2ri2
Messages: 11 Registered: February 2008
|
Junior Member |
|
|
On Apr 10, 12:11 am, rhyme2ri2 <rhyme2...@gmail.com> wrote:
> Hello all,
>
> I want to read an html(web) page. I am able to do this using socket
> but the problem is that i don't know the size of the page. Is there
> any possible way to know the size of page before reading it using
> sockets. The size is needed as i need to allocate buffer on the basis
> of this size.
>
> Or, if there is a better way to read an html(web) page in idl then
> please let me know.
>
> Thanks & Regards
> -Ritu
Yup....
Don't bother folks..
I got the solution.....
Thanks..
|
|
|