LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-05-2005, 08:18 AM   #1
fiomba
Member
 
Registered: Sep 2004
Posts: 63

Rep: Reputation: 15
How to deal with a ASP file?


Hi all,
recently I had to download a lot of data from Internet from an asp file.
I know it is a Windows IIS component, but do you know how to deal with it in Linux?
The problem is that to download the data I had to click 220 times on a button "Page Down", and each time cut & paste the relevant data.
Such data are indeed scattered on 220 pages, reachable only from inside the browser (I use konqueror, but I think that the same happens with Mozilla or Firefox and perhaps IE).
From my limited experience, I tried wget and macro approach with OpenOffice, but with no luck.
IMHO the macro approach is the solution, but how to program such actions (press a button then cut & paste or simply save the html page)?
Another solution could be to use DCOP to access konqueror browser, but I am still a newbie in this field...
I already have the data (after almost 2 hours of "by hand" approach), but I should prefer to better spend my time (programming for example a script that does the job for me...).
Can you help me?
Bye.
 
Old 10-05-2005, 08:39 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I believe, but I could be wrong, that ".asp" is a way of displaying a file which is not html. I remember I downloaded an ".asp" file from NIST. When I viewed it online it opened up in the ".pdf" viewer. So, when I downloaded the file, I changed the .asp to .pdf. Then it worked just like a pdf file. You might try to "view source" in your browser, and try to determine what kind of file it is. Or, in the source, there may be a path to the actual file. Many times I have viewed the source of a page to figure out how to get what I want. The way to save the page you are looking at is "File>Save As>name the file>OK". then you have a copy you can open up in your browser. You can also extract all the text out of a file with grep - man grep.
 
Old 10-05-2005, 07:15 PM   #3
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
No a .asp file is a script written in Microsoft's ASP scripting language. You can't download the actual .asp file from the remote webserver - when you request the page the webserver will run the ASP script and send you the output (which usually is a HTML page). This is the same as any of the other web scripting languages out there such as PHP, JSP etc. Linux browsers can access .asp web pages just as well as Windows browsers because the script runs on the server-side and the browser only has to deal with the HTML it outputs. Also if you want to do ASP scripting on a Linux server there is an ASP module for Apache.

Quote:
I remember I downloaded an ".asp" file from NIST. When I viewed it online it opened up in the ".pdf" viewer. So, when I downloaded the file, I changed the .asp to .pdf. Then it worked just like a pdf file.
If that's the case then the NIST people had a slight misconfiguration in their ASP script. There's nothing stopping an ASP script outputing a PDF file (instead of a HTML page or anything else) but they should have also got it to send the proper content-type header to your browser so that it knew to interpret the output as a PDF file.
 
Old 10-05-2005, 08:59 PM   #4
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
if you have access to the file remotely download it(ftp, etc...)
Can you get the php script showing this thread(in the location bar of your browser): showthread.php, i don't think so...
 
Old 10-06-2005, 04:43 AM   #5
fiomba
Member
 
Registered: Sep 2004
Posts: 63

Original Poster
Rep: Reputation: 15
Hi all,
thank you for your replies. IMHO tkedwards is correct, Active Server Pages (asp) is a proprietory scripting language from MS, running on a web server (generally with IIS, Internet Information Server) and each browser makes only the script to run on the server and every time I click on the "Page Down" button the script prepares a new html page (after having accessed its internal db for the new asked data).
Answering to mrcheeks: I have no access to the remote server. I shold emulate a browser (DCOP ?) to make the asp script running on the server. I hoped to solve the problem with wget which indeed has a kind of browser simulation (only for the downloading side) but wget does not know how to deal with asp files; it merely downloads the 1st page (of 220) as an html file.
For these reason I was convinced that the only solution was a kind of macro script, but in this field Linux is far away from MS (sigh!).
Bye.
 
Old 10-06-2005, 06:35 AM   #6
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
asp is interpreted, asp is transformed into html(by the asp engine) when you access the script from a browser. asp script can run in iis and if i remember if other servers you have to pay for(Sun microsystems had one i think)

if the script was
<%response.write("test")%>

the only thing you would get download the script is a text/html file containing
test

i hope you understand what i am trying to say. You cannot get the script itself unless you have the files or hack the server.

What kind of macro script are you talking about??
 
Old 10-06-2005, 08:57 AM   #7
azucaro
Member
 
Registered: Jan 2005
Location: Washington, D.C.
Distribution: Arch (Custom), CentOS
Posts: 239

Rep: Reputation: 30
So if you need to grab a bunch of data from the output of this asp script, is it possible for you just save the source (by this I mean the html displayed on your browser) and grab the needed information with a Perl script? In my opinion Perl was born for stuff like this. I know that you might not know the language, but if this is critical to you it might be useful to learn just enough to do this task.


Last edited by azucaro; 10-06-2005 at 09:25 AM.
 
Old 10-06-2005, 08:59 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Microsoft loves Visual Basic. When they use it on their proprietary web-server they call it ASP. It is a server-side scripting language... not a type of file that you can receive.
 
Old 10-06-2005, 05:34 PM   #9
fiomba
Member
 
Registered: Sep 2004
Posts: 63

Original Poster
Rep: Reputation: 15
Hi all,
thank you again. Firstly I must answer to mrcheeks. Unfortunately I haven't got your point because I am not an hacker or an expert. Instead I am still a kind of newbie.
I can only give you my point of view on macro scripts. IMHO that is a general solution not only applicable to the case we are examining, but also to many others (for example for making automatically internet searches). The macro approach is widely used under Windows (macro express, macro scheduler or even macros under Office). With such an approach you can emulate exactly a user in his keyboard and mouse operations.
My current attempt is to use DCOP (Desktop COmmunication Protocol). As a matter of fact I use (also for this reason) a KDE browser (konqueror) and it should be enough to send through a script simulated keys (tab, Enter , Alt + other keys) to the application for shifting the focus on Page Down button, than clicking it by sending '\n'. After that you must access Save As by Alt+'a' and at last save the html page sent by the server using incremented filenames like 001.html, 002.html...220.html.
This is the most difficult part because there is not much documentation on DCOP and, besides that, there are very few applicative examples of DCOP. I must study and make some test, using DCOP-Python bindings (I don't know C++).
About the replay of the last two guys (azucaro and sundialsvcs) I don't think that a Perl script can in a simple way be the solution. By the way, asp (Active Server Pages) is not a script based on VB but on Activex ... but I can be wrong.
Bye.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the deal? vagabondmuse Fedora 5 12-30-2003 08:45 PM
can play asx,asp file in redhat9? eye Red Hat 1 10-28-2003 08:01 PM
What is correct code for "Include File Function" on .asp pages gregoryfrancis Linux - General 1 02-11-2003 10:49 PM
ASP? ASP for Perl? northwind blank Linux - Networking 3 02-04-2003 10:52 AM
httpd - asp or apache - asp vcheah Linux - General 2 01-18-2002 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration