Jump to content

Scraping another URL


darmohray

Recommended Posts

I need help in writing some client-side Javascript (for page 1) that will request a new URL (page 2), parse the resulting HTML, find a set of email addresses embedded in an HTML table, and then finally call a another page (page 3) passing as query strings the emails found on page 2.

 

I know how to do a window.open("URL"), but how to actually have the javascript get the resulting HTML as a long string, and then parse it looking for email addresses?

 

Thanks for any help/advice you can provide.

 

Gregory

Link to comment
Share on other sites

Gregory-

 

I would recommend using AJAX. This is because JavaScript is a client-side scripting language, meaning it doesn't have access to a lot of server functions. I would use AJAX that makes an asynchronous to some server scripting file on your web server, and have that file parse your second page and send the e-mail result back to the AJAX handler. There are tons and tons of AJAX libraries and tutorials out there.

 

That is the route I would take.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.