我想测试 Shodan 数据。数据包括时间戳、爬虫 ID、服务器操作系统等字段。这些内容在每次请求时都会发生变化。哇,我应该测试它们吗?
Shodan JSON 数据:
{
"city": "Mountain View",
"region_code": "CA",
"os": null,
"tags": [],
"ip": 134744072,
"isp": "Google",
"area_code": 650,
"dma_code": 807,
"last_update": "2017-03-04T13:54:57.176297",
"country_code3": "USA",
"country_name": "United States",
"hostnames": [
"google-public-dns-a.google.com"
],
"postal_code": "94035",
"longitude": -122.0838,
"country_code": "US",
"ip_str": "8.8.8.8",
"latitude": 37.385999999999996,
"org": "Google",
"data": [
{
"_shodan": {
"options": {},
"id": null,
"module": "dns-udp",
"crawler": "122dd688b363c3b45b0e7582622da1e725444808"
},
"hash": -553166942,
"os": null,
"opts": {},
"ip": 134744072,
"isp": "Google",
"port": 53,
"hostnames": [
"google-public-dns-a.google.com"
],
"location": {
"city": "Mountain View",
"region_code": "CA",
"area_code": 650,
"longitude": -122.0838,
"country_code3": "USA",
"country_name": "United States",
"postal_code": "94035",
"dma_code": 807,
"country_code": "US",
"latitude": 37.385999999999996
},
"timestamp": "2017-03-04T13:54:57.176297",
"domains": [
"google.com"
],
"org": "Google",
"data": "\nRecursion: enabled",
"asn": "AS15169",
"transport": "udp",
"ip_str": "8.8.8.8"
}
],
"asn": "AS15169",
"ports": [
53
]
}
我的测试文件:
def test_shodan_api():
assert shodan_data == ???