今天9时22分,搭载神舟十二号载人飞船的长征二号F遥十二运载火箭,在酒泉卫星发射中心准时点火发射,神舟十二号载人飞船与火箭成功分离,进入预定轨道,顺利将聂海胜、刘伯明、汤洪波3名航天员送入太空,发射取得圆满成功。我觉得,神舟飞船的不断升空,更多像是一种符号,是国力增强的象征。他们的出征是为更多的星星,为更遥远的星河,期待凯旋!
所以今天作为大数据工作者我们也为自己布置了一份作业,爬取中国CZ系列火箭发射记录,知道CZ火箭的很多,但是关于CZ系列火箭其他一些知识知道的人并不多,那么今天我们就爬取一些数据分析下CZ系列火箭都在哪些发射场发射过,哪个月份是火箭发射的高峰期,哪个发射场承担过最多的火箭发射任务。
数据来源我们可以在中国运载火箭技术研究院的官网上获取www.calt.com/n482/n505/i…
import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.HostConfiguration;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.GetMethod;
import java.io.IOException;
public class Main {
# 代理服务器(产品官网 www.16yun.cn)
private static final String PROXY_HOST = "t.16yun.cn";
private static final int PROXY_PORT = 31111;
public static void main(String[] args) {
HttpClient client = new HttpClient();
HttpMethod method = new GetMethod("http://www.calt.com/n482/n505/index.html");
HostConfiguration config = client.getHostConfiguration();
config.setProxy(PROXY_HOST, PROXY_PORT);
client.getParams().setAuthenticationPreemptive(true);
String username = "16ABCCKJ";
String password = "712323";
Credentials credentials = new UsernamePasswordCredentials(username, password);
AuthScope authScope = new AuthScope(PROXY_HOST, PROXY_PORT);
client.getState().setProxyCredentials(authScope, credentials);
try {
client.executeMethod(method);
if (method.getStatusCode() == HttpStatus.SC_OK) {
String response = method.getResponseBodyAsString();
System.out.println("Response = " + response);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
method.releaseConnection();
}
}
}
HttpClient4.x
JSoup
JSoup全局代理
Connection
Htmlunit
Okhttp
复制代码
盼航天英雄平平安安,顺顺利利!
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END