PDA

View Full Version : Resolved Using Ajax.open to grab text from specific <div> tag


neochronomo
01-28-2010, 09:07 AM
I'm trying to make a script for Windows Plus! Live that will grab text from a webpage, parse it for text between a specific <div> tag, and then send that text to a user through an instant message.

I know many of you may not be familiar with WP!L, but you can forget about the instant message part I think. The only thing that matters is grabbing text using ajax and parsing it. I can figure out the rest.

Here's an example website (http://macgyver89.webs.com/ajax_test.html). "1. test111" is between <div id="1"></div>, and so on.

In case you're still confused, here's a link to a WP!L script (http://www.msghelp.net/showthread.php?tid=73808&pid=810875#pid810875) that grabs text from a webpage using ajax, and then displays that text in your personal message.

EDIT: Forgot to mention this. WP!L only uses javascript and jscript. Other people have told me it's easier with PHP, but unfortunately I can't use it for this project.

seco
01-28-2010, 09:12 AM
ive always used jquery or php. jquery would be like

var str = $("#1").text();

neochronomo
01-28-2010, 10:16 AM
ive always used jquery or php. jquery would be like

var str = $("#1").text();

Thanks for the quick reply!

How would I use that with ajax? I've never done this before, so I'm a bit clueless. Is it possible that you could write this part for me? That may be asking too much, I don't know. It seems like it would be pretty short though.

Also, I forgot to mention this, but it has to be in javascript or jscript only (jquery is one of those, correct?). WP!L doesn't use anything else.

neochronomo
01-28-2010, 11:47 AM
Thanks for you help, but I believe I just figured it out :thumbsup:

I really appreciate it.