Project Address: Copywang/spiders_collection
Implementation features
- Crawl all phone comments list on phone interface
- Store to MongoDB
Steps
- Get the home phone list and get the URL of each phone title and detail page
- Open the Details page URL for the 1th step, respectively, and get the product ID
- Combine URLs based on product ID to assemble JSON requests for comment pages and get JSON data
- The top page contains the largest number of comment pages in the JSON data
- Use maximum comment pages as a loop to get comments on all pages
Problems encountered
- The JSON data returned contains some messy beginnings and cannot be used to generate a dictionary using the Json.loads () method
- Sometimes the request Comment page JSON will appear garbled
- For the time being, where multithreading is used properly
Improved
- Using the Json.loads () method
- Using multi-line
Crawled data:
05 Crawling Huawei website Vmall's mobile reviews