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
https://forums.phpfreaks.com/topic/55220-scraping-another-url/
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
https://forums.phpfreaks.com/topic/55220-scraping-another-url/#findComment-273018
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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