Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Thanked 0 Times in 0 Posts

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

  2. #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Thanked 619 Times in 599 Posts
    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.
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

  3. #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    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.
    Be yourself. No one else is as qualified.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts