05 Crawling Huawei website Vmall's mobile reviews

Source: Internet
Author: User

Project Address: Copywang/spiders_collection

Implementation features

  1. Crawl all phone comments list on phone interface
  2. Store to MongoDB

Steps

  1. Get the home phone list and get the URL of each phone title and detail page
  2. Open the Details page URL for the 1th step, respectively, and get the product ID
  3. Combine URLs based on product ID to assemble JSON requests for comment pages and get JSON data
  4. The top page contains the largest number of comment pages in the JSON data
  5. Use maximum comment pages as a loop to get comments on all pages

Problems encountered

  1. The JSON data returned contains some messy beginnings and cannot be used to generate a dictionary using the Json.loads () method
  2. Sometimes the request Comment page JSON will appear garbled
  3. For the time being, where multithreading is used properly

Improved

  1. Using the Json.loads () method
  2. Using multi-line

Crawled data:

05 Crawling Huawei website Vmall's mobile reviews

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.