There is no motivation for learning, so eating jujube is? In the process of learning nodejs, I will give you a little refreshing?

Here I used the most simple crawler tutorial of cnodejs community to do the basic change eel, completed

 //Initialize the project 
 NPM init 
 / / start app. JS 
 node app. JS 
 / / and you can enjoy it  Play fast (see the end of the article for the code)

If you don't know how to use nodejs
Linux players can watch This is my article ; windows players can go to the official website to download. MSI and install it next Through train


Basic crawling ideas

  1. Page pagination button, catch all the page links of little sister that appear on this page, and store them
  2. Use eventproxy to access the pages of each little sister concurrently
  3. In the process of accessing, cherio (a module similar to jQuery) is used to match the image address we need and record all the image addresses found
  4. HTTP to request each image address, save the binary data stream
  5. FS will binary data stream, output into a picture file, the file name is extracted from the original address
  6. Save to folder

Here I am afraid that because the request is too large, use express to build a static page to provide query and download To reduce the possibility of crawling to death

Download address: xjj.zip

label: nodejs , welfare , cute girl

Five comments have been made

  1.  sanko sanko

    The beauty of the same tune

  2. Node.js is still too high..

  3. Change eel

  4. Test comments

Add a new comment