Use JavaScript to write the crawler source, used to crawl the Shanghai Merchants Wealth online product information.
Paste the code into the arrow hand Cloud Crawler platform (http://www.shenjianshou.cn/) to run directly,
You do not need to install the compilation environment. To crawl other sites, you can change the source code.
Code execution specific step point here
Code detailed explanation point here
More source download points here
varConfigs ={domains: ["Www.hushangcaifu.com"], scanurls: ["Http://www.hushangcaifu.com/invest/index1.html"], contenturlregexes: ["Http://www\\.hushangcaifu\\.com/invest/a\\d{4}\\.html"], helperurlregexes: ["Http://www\\.hushangcaifu\\.com/invest/index\\d+\\.html"], fields: [{name:"Title", selector:"//div[contains (@class, ' Product-content-top-left-top ')]/h3/text ()", Required:true}, {name:"User_name", selector:"//div[contains (@class, ' Product-content-top-left-top ')]/p/span/text ()"}, {name:"Total_money", selector:"//div[contains (@class, ' Product-content-top-left-middle ')]/div[1]/h4/text ()"}, {name:"Project_time", selector:"//div[contains (@class, ' Product-content-top-left-middle ')]/div[2]/h4/text ()"}, {name:"Annual_return", selector:"//div[contains (@class, ' Product-content-top-left-middle ')]/div[3]/h4/text ()"}, {name:"Return_method", selector:"//div[contains (@class, ' Product-content-top-left-middle ')]/div[4]/h4/text ()" } ]};varCrawler =NewCrawler (configs); Crawler.start ();
Shanghai Merchants Wealth Crawler Source