各地楼市齐松绑,楼市信息实时分析

java (1466) 2022-08-01 21:43:31

最近央行、银监会和证监会齐齐发声:要支持资本市场平稳运行,及时优化房地产信贷政策,不能盲目抽贷、断贷、压贷,要保持房地产融资平稳有序。各地房地产的扶持政策不断推出,楼市政策放松的城市不断增加、放松的政策力度越来越大、形式多种多样。近期全国已有近90城(不含网传城市)出台房地产政策百余条。有的降首付,减少买房的现金支出。比如重庆、菏泽、赣州、佛山、南通等,刚需的买房朋友,可以根据自己城市的情况择机入手。下面的程序可以定期采集相关的信息,协助分析楼市情况:

package htmlunit;

import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class HtmlunitDemo {
    // 代理服务器(产品官网 www.16yun.cn)
    final static String proxyHost = "t.16yun.cn";
    final static Integer proxyPort = 31111;

    // 代理验证信息
    final static String proxyUser = "USERNAME";
    final static String proxyPass = "PASSWORD";

    public static void main(String[] args) {

        CredentialsProvider credsProvider = new BasicCredentialsProvider();
        credsProvider.setCredentials(

        new AuthScope(proxyHost, proxyPort),
        new UsernamePasswordCredentials(proxyUser, proxyPass));
        WebClient webClient = new WebClient(BrowserVersion.CHROME,proxyHost, proxyPort);

        webClient.setCredentialsProvider(credsProvider);

        webClient.setAjaxController(new NicelyResynchronizingAjaxController());
        webClient.getOptions().setJavaScriptEnabled(true);
        webClient.getOptions().setThrowExceptionOnScriptError(false);
        webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
        webClient.getOptions().setActiveXNative(false);
        webClient.getOptions().setCssEnabled(false);

        HtmlPage page = null;

        try {
            page = webClient.getPage("https://www.thepaper.cn/newsDetail_forward_17952779");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            webClient.close();
        }

        webClient.waitForBackgroundJavaScript(30000);

        String pageXml = page.asXml();

        System.out.println(pageXml);
    }
}
THE END

发表评论

下一篇

已是最新文章