Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
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.
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.
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...
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.