Link to home
Start Free TrialLog in
Avatar of caciqueman
caciqueman

asked on

Fetch a .jsp generated page using LWP & Perl

I would like to fetch a web page using the  LWP module, and have the results parsed and then
email users based on the contents of the page.  I have a perl scrip tthat I can modify  to do that.
My problem is,  the website I need the information from generates the page using  javascript,
 and the results appear on the browser  with the extension of .jsp (example: : landregister_new.jsp) ,
which is difficult  for me to even print the screen on, using my netscape 4.6,  let alone return something
 suitable  for parsing.

Can anyone provide  a perl script or some java code or whatever,  to convert the .jsp to html (preferably)
 or ascii, or .txt or  something that I can handle with a perl script ?
Avatar of jmcg
jmcg
Flag of United States of America image

A suffix of .jsp means that Java Server Pages is being used to generate the page, but what arrives in response to the request should still be HTML, possibly with embedded Javascript. Unless some fancy games are being played, the data you want should probably be there in the HTML. Perhaps if you could provide a sample or example of what's causing you a problem?

Do you have 'lynx' available? It's a text-only browser. Can it render the data you want on these pages? If so, another approach you can take is to dump the page with lynx and use ordinary regular expressions and such to take the page apart and extract the data you're interested in.
Avatar of caciqueman
caciqueman

ASKER

I don't have lynx, and I am fetching this for use on a unix server, and then parsing
the html for certain phrases.  I think the problem is arising because the html page
that calls the .jsp page is fine, but from the .jsp page you need to make a further
selection to proceed....so basically that's why I wanted a script to be able to pass
from the .jsp page one to page two, WITH the completed choice from page one. I
know the data that I need passed, so thats not a problem.
ASKER CERTIFIED SOLUTION
Avatar of jmcg
jmcg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I won't go the lynx route but thank you for your information.