classes and code snippets to download a web page

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

classes and code snippets to download a web page

Joseph Alotta
Greetings,

I am looking for classes and code snippets to download a statement from my mutual fund company.

It would have to login, submit the password and then download from a link.

Does anyone have code that does this?


Sincerely,

Joe.


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Ron Teitelbaum

> From: Joseph J Alotta

> Sent: Friday, May 24, 2013 1:08 PM

>

> Greetings,

>

> I am looking for classes and code snippets to download a statement from my

> mutual fund company.

>

> It would have to login, submit the password and then download from a link.

>

> Does anyone have code that does this?

>

 

Hi Joe,

 

Have a look at WebClient httpGet: ‘http://yourAddress.com/yourLinkToDownload’

 

It handles everything you need.

 

All the best,

 

Ron Teitelbaum

Head Of Engineering

3d Immersive Collaboration Consulting

[hidden email]

Follow Me On Twitter: @RonTeitelbaum

www.3dicc.com

3d ICC on G+

 

>

> Sincerely,

>

> Joe.

>

>

> _______________________________________________

> Beginners mailing list

> [hidden email]

> http://lists.squeakfoundation.org/mailman/listinfo/beginners

 


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Joseph Alotta
In reply to this post by Joseph Alotta
I cannot find the WebClient class.  There needs to be a way to insert login information.

Remember you are talking with a beginner here.

Can someone please post a working snippet of code?


Sincerely,

Joe.



> Greetings,
>
> I am looking for classes and code snippets to download a statement from my mutual fund company.
>
> It would have to login, submit the password and then download from a link.
>
> Does anyone have code that does this?
>
>
> Sincerely,
>
> Joe.
>
>
> Hi Joe,
>
>
>
> Have a look at WebClient httpGet:
> 'http://yourAddress.com/yourLinkToDownload'
>
>
>
> It handles everything you need.
>
>
>
> All the best,
>
>
>
> Ron Teitelbaum

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Casey Ransberger-2
I think WebClient is a part of the WebServer package on SqueakSource.

CC Ron who might know more about current events.

I've used it to do web-service style back end stuff but that's the limit of my experience with it.

Also worth noting, I'm on a lot of mailing lists, which can cause messages to scroll past without my noticing them. Feel free to CC me on further dialogue in addition to the beginners list, and I will help if I can.

Casey

On May 25, 2013, at 9:28 AM, Joseph J Alotta <[hidden email]> wrote:

> I cannot find the WebClient class.  There needs to be a way to insert login information.
>
> Remember you are talking with a beginner here.
>
> Can someone please post a working snippet of code?
>
>
> Sincerely,
>
> Joe.
>
>
>
>> Greetings,
>>
>> I am looking for classes and code snippets to download a statement from my mutual fund company.
>>
>> It would have to login, submit the password and then download from a link.
>>
>> Does anyone have code that does this?
>>
>>
>> Sincerely,
>>
>> Joe.
>>
>>
>> Hi Joe,
>>
>>
>>
>> Have a look at WebClient httpGet:
>> 'http://yourAddress.com/yourLinkToDownload'
>>
>>
>>
>> It handles everything you need.
>>
>>
>>
>> All the best,
>>
>>
>>
>> Ron Teitelbaum
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Levente Uzonyi-2
In reply to this post by Joseph Alotta
On Sat, 25 May 2013, Joseph J Alotta wrote:

> I cannot find the WebClient class.  There needs to be a way to insert login information.
>
> Remember you are talking with a beginner here.
>
> Can someone please post a working snippet of code?

To install WebClient:

Installer ss
  project: 'WebClient';
  install: 'WebClient-Core'.

To fetch something (username and password will be asked if and
when needed):

response := WebClient httpGet: 'http://example.com'.

If you want to specify the username and password beforehand and have no
interaction (no asking for username/passord if the specified ones are
incorrect):

client := WebClient new.
client authParams: (Dictionary new
  at: #username put: 'your username here';
  at: #password put: 'your password here';
  yourself).
response := client httpGet: 'http://example.com'.

In both cases 'response' will be a WebResponse object. You can check if
your request was successful:

response isSuccess.

or get the response code:

response code.

or get the content of the response (if it exists):

response content.


Levente

>
>
> Sincerely,
>
> Joe.
>
>
>
>> Greetings,
>>
>> I am looking for classes and code snippets to download a statement from my mutual fund company.
>>
>> It would have to login, submit the password and then download from a link.
>>
>> Does anyone have code that does this?
>>
>>
>> Sincerely,
>>
>> Joe.
>>
>>
>> Hi Joe,
>>
>>
>>
>> Have a look at WebClient httpGet:
>> 'http://yourAddress.com/yourLinkToDownload'
>>
>>
>>
>> It handles everything you need.
>>
>>
>>
>> All the best,
>>
>>
>>
>> Ron Teitelbaum
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Joseph Alotta
In reply to this post by Joseph Alotta
Thanks Levente.

Is there a way to click on a link and navigate on the website?


Sincerely,

Joe.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Joseph Alotta
In reply to this post by Joseph Alotta
I was able to Install Webclient.

But when I try to use the snippet below, I get a walkback window "Error: SqueakSSL is missing".

How do I install SqueakSSL?



> client := WebClient new.
> client authParams: (Dictionary new
> at: #username put: 'your username here';
> at: #password put: 'your password here';
> yourself).
> response := client httpGet: 'http://example.com'.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Levente Uzonyi-2
On Sun, 26 May 2013, Joseph J Alotta wrote:

> I was able to Install Webclient.
>
> But when I try to use the snippet below, I get a walkback window "Error: SqueakSSL is missing".
>
> How do I install SqueakSSL?

Installer ss
  project: 'SqueakSSL';
  install: 'SqueakSSL-Core'.

You'll also need the SqueakSSL plugin for your platform. Precompiled
binaries are available here:
http://squeakssl.googlecode.com/files/SqueakSSL-bin-0.1.5.zip

The plugin should be in either the VM's or the image's directory.

To see if you did everything right install the tests and see if they pass:

Installer ss
  project: 'SqueakSSL';
  install: 'SqueakSSL-Tests'.


Levente

>
>
>
>> client := WebClient new.
>> client authParams: (Dictionary new
>> at: #username put: 'your username here';
>> at: #password put: 'your password here';
>> yourself).
>> response := client httpGet: 'http://example.com'.
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: classes and code snippets to download a web page

Levente Uzonyi-2
In reply to this post by Joseph Alotta
On Sun, 26 May 2013, Joseph J Alotta wrote:

> Thanks Levente.
>
> Is there a way to click on a link and navigate on the website?

Assuming that you're downloading HTML, you should use an HTML parser
to parse the response, then find the links and "click" on them.

There's no web browser implemented in Squeak that qualifies for today's
standards. If you need a web browser which you can control with code, then
consider using an external tool, like PhantomJS (http://phantomjs.org/ ).


Levente

>
>
> Sincerely,
>
> Joe.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners