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 ?
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 ?
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I won't go the lynx route but thank you for your information.
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.