|  |
08-17-2004, 03:30 PM
|
#1 (permalink)
|
Monster Techie Join Date: May 2004 Location: Tucson, AZ, USA Posts: 1,183
| PHP Parsing a .ASP page -- possible? I'm just curious if anyone knows if this is possible...
what I'm trying to do is extract just the gasoline prices from a site: http://www.tucsongasprices.com/index.asp, starting at "LOWEST" and ending at "HIGHEST"...but being a .ASP page--one which I've never tried doing this with before...I'm having trouble, and quite frankly, not even sure if it's possible...so if anyone knows, or could help me with this, please let me know...thanks!
-X |
| |
08-17-2004, 05:11 PM
|
#2 (permalink)
|
Super Techie Join Date: Dec 2003 Posts: 333
| is that your own website? if not, they won't let you read the source code of that page. what you can do is, highlight the table that you want to extract, copy and paste it on notepad. Save it. Then write a php code, open the file, read each line into an array ( file() function), then you can do anything you want to manipulate it. you can output the file upsidedown into a table.
__________________ I do this for Aiur. NOT YOU. |
| |
08-17-2004, 06:51 PM
|
#3 (permalink)
|
Monster Techie Join Date: May 2004 Location: Tucson, AZ, USA Posts: 1,183
| No--it's not my web site! I just want to get the information on its own, so I can reformat it...
What you just said: could you tell me how I'd do that? I'm fairly new with this stuff...if you don't mind! Thanks for the help so far!
& one other thing--why can't I read the code? I mean, if I open the given page in the browser, and view source, it is there--why wouldn't it already "render" the code for when my script trys to interact with it?
Thanks!
-X
__________________ |
| |
08-17-2004, 07:59 PM
|
#4 (permalink)
|
Super Techie Join Date: Apr 2004 Posts: 316
| PHP can parse a file with a .asp extension with PHP in it, with some configuration of apache, but it cannot parse actually ASP .NET code.
And when you do a 'Veiw Source' all it will show you is the HTML code output after any PHP/ASP/Jscript ect. is run
__________________ BlazingWolf
<font color=\'red\'>
<b>
<a href=\'http://www.gaming-forums.org\'>
Gaming-Forums.org
<a/>
</b>
</font> |
| |
08-18-2004, 01:40 AM
|
#5 (permalink)
|
Monster Techie Join Date: May 2004 Location: Tucson, AZ, USA Posts: 1,183
| Yeah--is there any way to "run" the script and then extract the code? As I simply want part of the output...!
thanks, -X
__________________ |
| |
08-18-2004, 09:12 PM
|
#6 (permalink)
|
Super Techie Join Date: Dec 2003 Posts: 333
| NO there is not such way because the source code is a BIG SECRETE and every site will try his best not let you find out the code.
__________________ I do this for Aiur. NOT YOU. |
| |
08-18-2004, 11:32 PM
|
#7 (permalink)
|
Monster Techie Join Date: May 2004 Location: Tucson, AZ, USA Posts: 1,183
| Umm, but simply loading the page and viewing the source reveals the code...it's not that special, but I think it can be done...actually, I'm sure of it, just not sure how...YET! Maybe have some sort of server-side script that writes the code to a file, then I could parse it? Hmm, not sure...but I will figure this out :-)
__________________ |
| |
08-18-2004, 11:38 PM
|
#8 (permalink)
|
Super Techie Join Date: Dec 2003 Posts: 333
| ok there are TWO sets of code. One is the code that generates the webpage. the other one is the code that was generated by the first code, and is actually the html file. the first code is the BABY and nobody will let you see it. No server-side stuff cuz you even don't have the access to the server. just do what I said at first, copy the table and paste it in notepad, and it will be in PERFECT order. save it. then you can just write your own php code and read the saved file, then generate another html file that sorts out the table. of course you will need a server that runs php to do it. if you don't have one, quit thinking about this thing unless you are willing to write a program to do it.
__________________ I do this for Aiur. NOT YOU. |
| |  | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | |