![]() |
Ajax to extract a div from another page possible?
Would it be possible to use Ajax and take a portion such as in a div from another page?
|
Sure, as long as the other page is on the same domain.
|
It is possible to grab HTML information from other domains as well, but in this case you need a server-side application (written in php, asp...) which receives the AJAX request, sends it to another server, gets the response and sends it back to the AJAX object.
|
Is there any tutorial related to this ( Ajax and php )? I asked this question in the php section but I think my post got deleted without me getting any further.
|
I found myself a ready-made php application for that on doing a simply google (I wanted not to reinvent the wheel)... I can not give you the link towards right now, as I am home, not at the office, but gimme a PM to remind me, and I might point you to that. Fell free to google yourself for, but you must know the basis of php to work with...
|
Quote:
|
Quote:
|
Here's a link for the article and php applications:
http://www.troywolf.com/articles/php/class_http/ I tested and used that successfully, together with AJAX in one of my sites. |
1 Attachment(s)
Quote:
class_http.php example.php I pasted every other bits of codes mentioned in your link in the example page. But if I'm going to simply pick up, let's say the div tags from another page how would that be possible? Which scripts apply to that? |
Screen scraping is not very nice thing to do....You should get permission before taking someone else's content and causing extra load on their servers....
Eric |
I want to use it from my own pages. I give myself the permission.
|
Quote:
Eric |
Quote:
|
Ok I looked into JSON. From what I've seen JSON isn't what I'm looking for. My intention of grabbing information from one source to the next is from my own domain is to populate them in a database. I have a 700 paged ebook converted to html. So I want to grab all the div tags automatically instead of me doing things manually. DO you understand what I'm saying?
|
We do understand. It is possible, but... do you have "700 paged ebook" and no DataBase?
|
| All times are GMT +1. The time now is 06:50 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.