update
This commit is contained in:
+2
-2
@@ -29,9 +29,9 @@ public class ExportNearestAvgPrice {
|
|||||||
static main(args) {
|
static main(args) {
|
||||||
|
|
||||||
|
|
||||||
def citys = ["苏州"]//findAllCity();
|
def citys = ["重庆"]//findAllCity();
|
||||||
def task = new ExportNearestAvgPrice();
|
def task = new ExportNearestAvgPrice();
|
||||||
def weekends = task.findWeekends(34);//日期最近的X期
|
def weekends = task.findWeekends(12);//日期最近的X期
|
||||||
|
|
||||||
// task.exportAllCity(citys, weekends, "e:\\全国城市均价.csv");
|
// task.exportAllCity(citys, weekends, "e:\\全国城市均价.csv");
|
||||||
task.exportRegion(citys, weekends, "D:\\数据\\区域均价.csv");
|
task.exportRegion(citys, weekends, "D:\\数据\\区域均价.csv");
|
||||||
|
|||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
package com.fangjia.script.gj.crawl
|
||||||
|
|
||||||
|
import com.fangjia.script.util.ABuYunUtil
|
||||||
|
import com.fangjia.script.util.ExcelUtils
|
||||||
|
import net.sf.json.JSONObject
|
||||||
|
|
||||||
|
class AnjukeDistSearch {
|
||||||
|
static main(args) {
|
||||||
|
def task = new AnjukeDistSearch()
|
||||||
|
task.run()
|
||||||
|
}
|
||||||
|
|
||||||
|
def run(){
|
||||||
|
def file = "D:\\Êý¾Ý\\Ë·ÖÝÆ¥Åä·¿Ô´1.xlsx"
|
||||||
|
ExcelUtils.modify(file,{d->
|
||||||
|
def data = getDataInfo(282, d['C'])
|
||||||
|
if(data){
|
||||||
|
def match = data.match
|
||||||
|
if(match){
|
||||||
|
println match
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getDataInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
def getDataInfo(cityId, keyword){
|
||||||
|
def url = "https://m.anjuke.com/ajax/autocomplete/?city_id=282&kw="+URLEncoder.encode(keyword, "utf-8")
|
||||||
|
def ret = ABuYunUtil.doGet(url, null, null, "utf-8")
|
||||||
|
if (ret) {
|
||||||
|
JSONObject jsonObj = JSONObject.fromObject(ret);
|
||||||
|
if (jsonObj && jsonObj.msg == "ok") {
|
||||||
|
def data = jsonObj.data
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user