Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-18-2012, 12:56 PM   PM User | #1
haghadi
New to the CF scene

 
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
haghadi is an unknown quantity at this point
Web scraping in Javascript

I am new to javascript and want to learn about webscraping. I’ve looked at some tutorials but I am still very confused. For instance, I want to make a javascript app that takes input a book ISBN number and feeds it to http://www.lookupbyisbn.com/ and gets the results from it and shows it to me.


Can someone show me how to do it??
haghadi is offline   Reply With Quote
Old 08-18-2012, 03:33 PM   PM User | #2
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,468
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
you have to use node.js or something else that can fetch urls from anywhere.
i would recommend using an html5 DOM parser so that your code is standardized between systems (html5 parsers are all the same).

the 2nd easiest way is using php and xpath.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote
Old 08-18-2012, 10:19 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,237
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
What Rnd_Me neglected to say: JavaScript can not *directly* read content from another site.

So you need a simple server-side proxy (as he stated) to go read the content and then serve it up to your JavaScript code so that, from the browser's perspective, you are reading content from your own site. You can create a server-side proxy very simply in most any server-side system: PHP, ASP. JSP, ASP.NET, or even Node.js.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Tags
html/css, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:29 AM.


Advertisement
Log in to turn off these ads.