CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ajax and Design (http://www.codingforums.com/forumdisplay.php?f=55)
-   -   Ajax to extract a div from another page possible? (http://www.codingforums.com/showthread.php?t=133149)

gilgalbiblewhee 02-12-2008 12:32 PM

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?

Inigoesdr 02-12-2008 12:35 PM

Sure, as long as the other page is on the same domain.

Kor 02-12-2008 03:44 PM

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.

gilgalbiblewhee 02-12-2008 09:21 PM

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.

Kor 02-12-2008 09:50 PM

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...

liorean 02-12-2008 09:50 PM

Quote:

Originally Posted by gilgalbiblewhee (Post 655249)
I asked this question in the php section but I think my post got deleted without me getting any further.

Actually you posted it here in the same forum, and it got deleted as an obvious dupe, seeing two threads right next to each other with the same subject and similar contents tends to make me do that.

gilgalbiblewhee 02-12-2008 11:16 PM

Quote:

Originally Posted by liorean (Post 655266)
Actually you posted it here in the same forum, and it got deleted as an obvious dupe, seeing two threads right next to each other with the same subject and similar contents tends to make me do that.

It wasn't intentional. I posted in the php section. I read the answer in my email. But when I clicked the link it wasn't there. But fortunately I had a tab already open. So I copied from that content and pasted it the the AJAX section.

Kor 02-13-2008 08:31 AM

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.

gilgalbiblewhee 03-24-2008 10:23 PM

1 Attachment(s)
Quote:

Originally Posted by Kor (Post 655430)
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.

I finally got a chance to look at the script and I tested it. I have two pages:
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?

A1ien51 03-25-2008 02:08 AM

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

gilgalbiblewhee 03-25-2008 03:39 AM

I want to use it from my own pages. I give myself the permission.

A1ien51 03-25-2008 05:52 AM

Quote:

Originally Posted by gilgalbiblewhee (Post 669273)
I want to use it from my own pages. I give myself the permission.

If it is from your own pages, than why don;t you build yourself a JSON servoce or a web service to get the info. There is no need to scrape a page when you own the code.

Eric

gilgalbiblewhee 03-25-2008 06:32 AM

Quote:

Originally Posted by A1ien51 (Post 669289)
If it is from your own pages, than why don;t you build yourself a JSON servoce or a web service to get the info. There is no need to scrape a page when you own the code.

Eric

JSON? Is that what it's called? Ok I'll look into it. Thanks.

gilgalbiblewhee 03-25-2008 06:17 PM

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?

Kor 03-25-2008 09:48 PM

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.