The source of the melon seeds for used cars

Source: Internet
Author: User

/* 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 ("&yen;", "¥"); 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

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.