当前位置:网站首页>Climbing 10000 NASA pictures about Mars exploration, I found a secret
Climbing 10000 NASA pictures about Mars exploration, I found a secret
2022-06-24 07:39:00 【Tangge engages in development】
Preface
lately , I use crawler technology , Crawling NASA , That's what you often see in movies NASA, Pictures of Mars exploration , Yes 10000 Zhang Ba .
Mm-hmm , Trifle thing , Trifle thing .
When it's done , A little excited , Hence the article , There will be the following :
- Why do I crawl NASA Pictures of the
- How do I crawl NASA The image ( Hyperdetail )
- What do I get ( HD map )
- What secret did I discover ( Super powerful )
Why do I climb NASA Pictures of the
I've passed 35 了 , Shivering when it was opened .
Every day I think about what to do if I lose my job , Think about playing we media , I'll talk to you everyday . Vernacular is a historical mystery , The mysteries of the universe , So I got my eye on NASA.
NASA There are all kinds of space exploration missions , And there are related articles , interview , picture , The video is public , This is a rare resource pool .
How do I crawl NASA The image ( Hyperdetail )
NASA Our website is publicly accessible , The address is
https://www.nasa.gov/
After opening , It looks like this , You can see all kinds of content . There's also a search box in the upper right corner , We type in Mars That is to say Mars
Wait a moment , Exhibition shows and Mars All kinds of related content , One of them Mars Exploration That is to say Mars exploration
After the light , It's a new page , And then find Images picture , It's the target page we crawled
https://www.nasa.gov/mission_pages/mars/images/index.html
Page drop down , You'll see a big button , It reads MORE IMAGES, Click to have a try and you'll find :
Content of page , It's not a page loaded directly , But through api After the request , Rendered asynchronously
F12, Open browser developer mode , Repeat the steps , Observe the request information , I find that there will be the following situations
Looks like this url The address is very important , Let's look at his request address first :
https://www.nasa.gov/api/2/ubernode/_search?size=24&from=24&sort=promo-date-time%3Adesc&q=((ubernode-type%3Aimage)%20AND%20(topics%3A3152))&_source_include=promo-date-time%2Cmaster-image%2Cnid%2Ctitle%2Ctopics%2Cmissions%2Ccollections%2Cother-tags%2Cubernode-type%2Cprimary-tag%2Csecondary-tag%2Ccardfeed-title%2Ctype%2Ccollection-asset-link%2Clink-or-attachment%2Cpr-leader-sentence%2Cimage-feature-caption%2Cattachments%2Curi
Pay attention to the parameters
size=24&from=24
Obviously ,size It's the number of images per request ,from After testing , Is the initial location of the query , We can change it to get other content
Let's look at its return message :
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 659,
"max_score": null,
"hits": [{
"_index": "nasa-public",
"_type": "ubernode",
"_id": "450040",
"_score": null,
"_source": {
"image-feature-caption": "Mars 2020 rover underwent an eye exam after several cameras were installed on the rover. ",
"topics": ["3140", "3152"],
"nid": "450040",
"title": "NASA 'Optometrists' Verify Mars 2020 Rover's 20/20 Vision",
"type": "ubernode",
"uri": "/image-feature/jpl/nasa-optometrists-verify-mars-2020-rovers-2020-vision",
"collections": ["4525", "5246"],
"link-or-attachment": "link",
"missions": ["6336"],
"primary-tag": "6336",
"cardfeed-title": "NASA 'Optometrists' Verify Mars 2020 Rover's 20/20 Vision",
"promo-date-time": "2019-08-05T17:49:00-04:00",
"secondary-tag": "3140",
"master-image": {
"fid": "603128",
"alt": "Engineers test cameras on the top of the Mars 2020 rover’s mast and front chassis. ",
"width": "1600",
"id": "603128",
"title": "Engineers test cameras on the top of the Mars 2020 rover’s mast and front chassis. ",
"uri": "public://thumbnails/image/pia23314-16.jpg",
"height": "900"
},
"ubernode-type": "image"
},
"sort": [1565041740000]
}, {
"_index": "nasa-public",
"_type": "ubernode",
"_id": "433172",
"_score": null,
"_source": {
"image-feature-caption": "NASA still hasn't heard from the Opportunity rover, but at least we can see it again.",
"topics": ["3152"],
"nid": "433172",
"title": "Opportunity Emerges in a Dusty Picture",
"type": "ubernode",
"uri": "/image-feature/opportunity-emerges-in-a-dusty-picture",
"collections": ["7628"],
"link-or-attachment": "link",
"missions": ["3639"],
"primary-tag": "3152",
"cardfeed-title": "Opportunity Emerges in a Dusty Picture",
"promo-date-time": "2018-09-26T12:39:00-04:00",
"secondary-tag": "7628",
"master-image": {
"fid": "584263",
"alt": "NASA's Opportunity rover appears as a blip in the center of this square",
"width": "1400",
"id": "584263",
"title": "NASA's Opportunity rover appears as a blip in the center of this square",
"uri": "public://thumbnails/image/pia22549-16.jpg",
"height": "788"
},
"ubernode-type": "image"
},
"sort": [1537979940000]
}]
}
} above json The content is too long , I deleted some of the duplicate , actually hits This array , It's also 24 individual , It's the same number of images that are displayed on the page . It can be concluded that , Information on the page , It's from this array .
And then we found that ,master-image Under the field , It's the information we need , Include Picture address , Picture size , Picture title .
Here's the code , Assembly request URL, Get content , Download the pictures Three steps
I use the Dart Language , You are at liberty
import 'dart:convert';
import 'package:dio/dio.dart';
main() async {
// The number of pages is fixed 24 individual , Just change the initial value
for (int from = 0; from < 24 * 100; from = from + 24) {
await getPage(from);
}
}
// Get information on every page and download
Future<void> getPage(int from) async {
String url = 'https://www.nasa.gov/api/2/ubernode/_search?size=24&from=' +
from.toString() +
'&sort=promo-date-time%3Adesc&q=((ubernode-type%3Aimage)%20AND%20(topics%3A3152))&_source_include=promo-date-time%2Cmaster-image%2Cnid%2Ctitle%2Ctopics%2Cmissions%2Ccollections%2Cother-tags%2Cubernode-type%2Cprimary-tag%2Csecondary-tag%2Ccardfeed-title%2Ctype%2Ccollection-asset-link%2Clink-or-attachment%2Cpr-leader-sentence%2Cimage-feature-caption%2Cattachments%2Curi';
// Get content
var res = await Dio().get(url);
var map = jsonDecode(res.toString());
(map['hits']['hits'] as List<dynamic>).forEach((element) async {
Uri fileUri = Uri.parse(getUri(element));
String savePath = getSavePath(element);
await Dio().downloadUri(fileUri, savePath);
print(' Downloaded : ' + savePath);
});
}
// Get the picture download address
String getUri(dynamic element) {
String uri = element['_source']['master-image']['uri'].toString();
uri = uri.replaceAll('public://',
'https://www.nasa.gov/sites/default/files/styles/full_width_feature/public/');
return uri;
}
// process information , And return to the picture save address
String getSavePath(dynamic element) {
String id = element['_id'];
String fid = element['_source']['master-image']['fid'].toString();
String title = element['_source']['master-image']['title'].toString();
String uri = element['_source']['master-image']['uri'].toString();
String savePath =
id + '_' + fid + '_' + title.trim() + '.' + uri.split('.').last;
savePath = savePath.replaceAll('/', '');
savePath = savePath.replaceAll('\\', '');
savePath = savePath.replaceAll('"', '');
savePath = 'images/' + savePath;
return savePath;
}The above code , It's still very simple , Experienced students should understand it as soon as they read it .
Let's go .
Downloaded : images/470436_643588_This is the third color image taken by NASA’s Ingenuity helicopter.jpg Downloaded : images/470435_643587_This is the second color image taken by NASA’s Ingenuity helicopter.jpg Downloaded : images/468546_639327_This is the first high-resolution, color image to be sent back by the Hazard Cameras (Hazcams).jpg Downloaded : images/452007_605784_Danielson Crater on Mars.jpg Downloaded : images/458478_615132_Gullies on Mars.jpg Downloaded : images/469416_641582_A field of sand dunes occupies this frosty 5-kilometer diameter crater in the high-latitudes of the northern plains of Mars..jpeg Downloaded : images/458075_614251_Mars 2020 With Sample Tubes (Artist's Concept).jpg Downloaded : images/470381_643473_CME.jpg Downloaded : images/458813_615896_Mars.jpg Downloaded : images/467026_635309_Illustration of NASA’s Perseverance rover begins its descent through the Martian atmosphere.jpg Downloaded : images/470438_643591_This black and white image was taken by NASA’s Ingenuity helicopter during its third flight on April 25, 2021.jpg Downloaded : images/465488_631398_Cliffs in Ancient Ice on Mars.jpg Downloaded : images/463659_626874_Avalanche on Mars.jpg Downloaded : images/470251_643164_This image from NASA’s Perseverance rover shows the agency’s Ingenuity Mars Helicopter right after it successfully completed a high-speed spin-up test..jpeg Downloaded : images/468636_639726_Mars' Jezero Crater.jpg
What do I get
These pictures
And these
picture , All the picture titles are available , It's been a month. I guess .
What secret did I discover
This picture , My favorite . One so clear , One so turbid , Why is that ? Martian crevice generators ?
ok , The real secret is :
NASA There is no anti collection on our website , Try it if you don't believe it ...
边栏推荐
- What are the dazzling skills of spot gold?
- Global and Chinese market of water massage column 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of bed former 2022-2028: Research Report on technology, participants, trends, market size and share
- Obtain the package name, application name, icon, etc. of the uninstalled APK through packagemanager. There is a small message
- Counter attack from outsourcing to big factories! Android has been developed for 5 years, and after a year of dormancy, it has tried to become an offer harvester. Tencent has a fixed salary of 20*15
- Black box and white box models for interpretable AI
- Canal installation configuration
- 【MySQL 使用秘籍】克隆数据表、保存查询数据至数据表以及创建临时表
- 【Vulhub靶场】】zabbix-SQL注入(CVE-2016-10134)漏洞复现
- 第三方软件测试公司如何选择?2022国内软件测试机构排名
猜你喜欢

两个链表的第一个公共节点_链表中环的入口(剑指offer)
![[image fusion] image fusion based on NSST and PCNN with matlab code](/img/b4/61a5adde0d0bfc5a339ef8ab948d43.png)
[image fusion] image fusion based on NSST and PCNN with matlab code

MaxCompute远程连接,上传、下载数据文件操作

bjdctf_2020_babystack

相机标定(标定目的、原理)
![buuctf misc [UTCTF2020]docx](/img/e4/e160f704d6aa754e85056840e14bd2.png)
buuctf misc [UTCTF2020]docx
![[OGeek2019]babyrop](/img/74/5f93dcee9ea5a562a7fba5c17aab76.png)
[OGeek2019]babyrop
![[equalizer] bit error rate performance comparison simulation of LS equalizer, def equalizer and LMMSE equalizer](/img/45/61258aa20cd287047c028f220b7f7a.png)
[equalizer] bit error rate performance comparison simulation of LS equalizer, def equalizer and LMMSE equalizer

Analog display of the module taking software verifies the correctness of the module taking data, and reversely converts the bin file of the lattice array to display

RDD基础知识点
随机推荐
Prefix and topic training
How to distinguish PAAS, IAAs and SaaS?
[GUET-CTF2019]zips
[image feature extraction] image feature extraction based on pulse coupled neural network (PCNN) including Matlab source code
【WordPress建站】5. 设置代码高亮
[WUSTCTF2020]爬
buuctf misc [UTCTF2020]docx
Mysql---三张表(student,课程,分数) 查询课程为数学的学生姓名,编号,成绩
Global and Chinese market of Earl Grey tea 2022-2028: Research Report on technology, participants, trends, market size and share
How to open the soft keyboard in the computer, and how to open the soft keyboard in win10
2.1.1 QML grammar foundation I
Graduation season advance technology
【Vulhub靶场】】zabbix-SQL注入(CVE-2016-10134)漏洞复现
PCL 点云按比率随机采样
Étalonnage de la caméra (objectif et principe d'étalonnage)
How to delete / select an input method on your computer
Global and Chinese market of basketball uniforms 2022-2028: Research Report on technology, participants, trends, market size and share
JVM debugging tool -jmap
Black box and white box models for interpretable AI
Actual target shooting - skillfully use SMB to take down the off-line host