/* Crawler source used in JavaScript, used to crawl the two rider information on the melon.
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
More source download points here
*/
varScanurl = "http://www.guazi.com/hz/buy/";//@input (scanurl, entry URL, enter a URL to crawl the city, in the format: "http://www.guazi.com/City name/buy/")if(Scanurl.trim (). length > 0) { varCity = Scanurl.trim (). substring (Scanurl.indexof (". com/") + 5, Scanurl.indexof ("/buy/"));}varConfigs ={domains: ["Guazi.com"], Scanurls: [Scanurl], contenturlregexes: ["https?:/ /www\\.guazi\\.com/"+ City +"/\\w+\\.htm "], helperurlregexes: ["https?:/ /www\\.guazi\\.com/"+ City +"/buy/(o\\d+/)? "], Enablejs:false, Interval:10000, fields: [{name:"Car_name", selector:"//h1[contains (@class, ' Dt-titletype ')]"}, {name:"Car_price", selector:"//span[contains (@class, ' fc-org pricestype ')]"}, {name:"Car_license", selector:"//li[contains (@class, ' one ')]/b"}, {name:"Car_mileage", selector:"//ul[contains (@class, ' assort ')]/li[2]/b"}, {name:"Car_gearbox", selector:"//ul[contains (@class, ' assort ')]/li[3]/b"}, {name:"Car_emission_standard", selector:"//li[contains (@class, ' Em-sta detailhovertips ')]/b"}, {name:"Car_license_location", selector:"//ul[contains (@class, ' assort ')]/li[5]/b"}, {name:"Car_owner", selector:"//li[contains (@class, ' owner ')]/text () [2]"}, {name:"Car_description", selector:"//*[@id = ' base ']/p"}]};configs.afterextractfield=function(fieldName, data, page) {if(FieldName = = "Car_price") { varPrice = Extract (data, "//b"). Replace ("¥", "¥"); varCoinunit = exclude (data, "//b"); return(Price +coinunit); } Else if(FieldName = = "Car_owner") { returnData.trim (); } Else if(FieldName = = "Car_description") { returnData.replace ("<em></em>", "" "); } returndata;};varCrawler =NewCrawler (configs); Crawler.start ();
The source of the melon seeds for used cars