京东物流


Java爬虫实现京东物流查询

时光怂恿深爱的人放手 提交于 2019-12-02 21:50:28
网上没有免费的接口,只能自己写一套了,参考代码如下 public static JSONObject getLastInfo(String no){ JSONObject jsonObject=new JSONObject(); jsonObject.put("no", no); Connection connection=Jsoup.connect("http://www.jdwl.com/order/search?waybillCodes="+no); connection.header("Referer", ""); connection.header("Host", "www.jdwl.com"); connection.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3"); connection.header("Accept-Language", "zh-CN,zh;q=0.9"); connection.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)

工具导航Map