On Sun, Jan 16, 2011 at 7:48 AM, Carl Wells <cgrwe...@yahoo.co.uk> wrote:

> Hi,
>
> I hope you don't mind my newbie question.  I'm new to web-programming (and
> indeed am somewhat rusty with programming in general).  I'm out of work and
> trying to teach myself C++, PERL, SQL and other skills and in order to do
> this I've set myself a project.  As part of this project I need to access
> data from this URL:
>
>
> http://www.reuters.com/finance/stocks/incomeStatement/detail?perType=ANN&symbol=BATS.L
>
> the problem I'm having is that this redirects to the reuters.com login
> page.  I've tried to use both existing cookie files from internet explorer
> (I had to rename these because the name of the cookie involved my user name
> which incorporates a space and an @ e.g. fred bumble...@honeypot.org and
> Perl didn't seem to like that/my syntax was wrong) and setting up perl to
> receive a new cookie from the site.  Neither has worked for me.  I've spent
> the past 3 days trying to glue bits of code together from various googles
> and the cpan module descriptions for LWP and Mechanize.  An example of code
> thats not working for me is as below:
>
>
Carl,

Hi there.  One big problem here is that the login page contains javascript.
If the javascript code is not run on the client side then whatever you post
will not work.
Sorry, but I do not know of a way around this, I've tried similar things in
the past and had no luck.  For forms that do not include javascript
WWW::Mechanize works nicely.

If you have any other specific perl issues post them here.  Or maybe someone
knows a way around this javascript issue and we'll both learn something.

You're tackling a lot of different things at one time: c++, perl, sql, CGI
and xs  - you may want to consider narrowing your focus a bit.

As far as the c++ issues go, I would suggest that you first have the perl
code write the data to disk, then have the c++ code read it off the disk, or
just do whatever you intend to do with the data all in perl.  Calling perl
from c++ is a large can of worms.  Unless you have a compelling reason for
doing this, I would advise against it.  It might be easier to put your c++
code in a library and then create a wrapper around that with xs.  One
approach that generally works for me is to identify stand alone tasks, get
them working by themselves, then work on making them play together.

Mike

Reply via email to