RE: Accessing Web from a program


No matter the libraries Tylor you still need to parse it.  You still have to
loop n he elements and pick out what you want which is what he is talking
about.  Just because there are dom trees don't mean you instantly get the
data out of it the way you want it. 

Just to end this thread I have a program almost done I started out using
WebBrowserControl in .net and had it working but didn't like how it was
forcing people to answer questions in dialogs when downloading the files  so
I switched to WebRequest which allows me to access the web as if I was a web
browser.  It is much harder with WebRequest because I have to keep track of
the Cookies and the session view but with a more difficult class I have much
more control over the interaction with the web pages I am accessing. 

Ken
-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of littlefield,
tyler
Sent: Thursday, March 06, 2008 3:14 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: Accessing Web from a program

you don't need to parse it. there are libs that already do it for you.

----- Original Message -----
From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, March 01, 2008 8:31 PM
Subject: Re: Accessing Web from a program


> Ok, I understand. I don't have a sample code that can help you, but 
> depending on what you want to do, it might be a little harder to do.
>
> To create the GUI may be simple, and to log on the server could be also 
> simple, but after logging in, it might be pretty hard to parse the web 
> page in order to get the relevant content (a table for example) and store 
> its content into a list in the GUI.
>
> If you would make the program in perl, you could use the accessible 
> libraries for creating GUIS (Win32::GUI or WxPerl), and me and Jamal had 
> presented some FruitBasket samples with these libraries. If you want to 
> log in a site, you could use a code like:
>
> use LWP::Simple;
> my $page_content = 
> get(http://www.site.com/login.php?username=user&password=pass);
>
> This will let you get the page that appears after you log in, and you can 
> parse its content. There are some CPAN modules that can help you to do 
> that, but I always prefered using simple regular expressions.
>
> Then you can print the result you got in the GUI.
>
> These are only the basics, because actually it is some more difficult.
>
> You shouldn't use LWP::Simple to get only a single page after you log in, 
> but you do need LWP::UserAgent, because it allows you to also get and save

> cookies, then send them to the server on the subsequent accesses, because 
> otherwise it won't consider you an authorized user.
>
> Doing these things could involve some work, but it is not such a difficult

> thing, but if you also want your app to work nice and to be responsive, 
> you might need to use some worker threads that fetch the pages, because 
> otherwise the app might seem to be frozen until the web page has been 
> fetched.
> Using threads in perl is not very easy, and that's why perl is not very 
> suitable for creating apps with GUIS. A perl thread is almost like a 
> process, and even if there are some modules that allow sharing simple 
> variables between threads, they don't allow you to share handles and 
> objects. Because of this, you can't share a database handle for example.
>
> Of course, for what you want, you might do it without many issues, but as 
> I never done exactly what you want, I don't know what problems could 
> appear.
>
> Octavian
>
> ----- Original Message ----- 
> From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
> To: <programmingblind@xxxxxxxxxxxxx>
> Sent: Sunday, March 02, 2008 12:28 AM
> Subject: RE: Accessing Web from a program
>
>
>>
>>
>> I am making a program that will log a person into their user account at a
>> less than accessible web page then I will present some tasks that they 
>> can
>> do their and give them an accessible gui rather than fight with an ugly 
>> web
>> interface..
>>
>> Ken
>>
>> -----Original Message-----
>> From: programmingblind-bounce@xxxxxxxxxxxxx
>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Octavian 
>> Rasnita
>> Sent: Saturday, March 01, 2008 11:53 AM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: Re: Accessing Web from a program
>>
>> Hi,
>>
>> I don't understand what you exactly want. Can you be a little more 
>> specific?
>>
>> Do you want a program with a native Windows GUI, or with a web based GUI?
>>
>> Do you want a simple CGI program made in perl that gets some parameters 
>> and
>> send them to the server, or you want a Windows GUI program that fetch a 
>> web
>> page and do something with its content, or send some content to a certain
>> program that runs on a web page?
>>
>>
>>
>>
>> Octavian
>>
>> ----- Original Message -----
>> From: "Ken Perry" <whistler@xxxxxxxxxxxxx>
>> To: <programmingblind@xxxxxxxxxxxxx>
>> Sent: Saturday, March 01, 2008 7:09 PM
>> Subject: Accessing Web from a program
>>
>>
>>>
>>>
>>> I am looking for sample code in any language that creates a dialog out 
>>> of
>>> a
>>> form on a web site and allows someone to submit that form after the 
>>> person
>>> enters the information.  Note that I need this to be GUI based and the
>>> GUI's
>>> must be accessible.  If there is a library for this just point that out
>>> and
>>> I will be off and running.  All the examples I have found on the web 
>>> just
>>> suck so I am hoping someone here has done it.
>>>
>>> Ken
>>>
>>>
>>
>> __________
>> View the list's information and change your settings at
>> http://www.freelists.org/list/programmingblind
>>
>> __________
>> View the list's information and change your settings at
>> http://www.freelists.org/list/programmingblind
>>
>
> __________
> View the list's information and change your settings at 
> http://www.freelists.org/list/programmingblind
> 

__________
View the list's information and change your settings at 
http://www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at 
http://www.freelists.org/list/programmingblind

Other related posts: