Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    1
    Thanks
    0
    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
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,461
    Thanks
    11
    Thanked 600 Times in 580 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.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,700
    Thanks
    80
    Thanked 4,658 Times in 4,620 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.
    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.


  •  

    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
    •