从Web域获取IP地址

问题描述 投票:0回答:1

我想检索任何给定域的IP地址,例如google.com将返回IP地址172.217.18.174

在Google表格上使用以下行我总是收到错误

“无法解析导入的XML内容。”

=importxml("http://xml.utrace.de/?query=google.com","//ip")

而且我也没有运气地试过以下的那些:

=importxml("http://xml.utrace.de/?query=google.com","//results/result/ip")
=importxml("http://xml.utrace.de/?query=google.com","/*")

任何帮助都非常感谢。

google-sheets google-sheets-formula google-sheets-query
1个回答
0
投票
=REGEXREPLACE(QUERY(IMPORTDATA("http://xml.utrace.de/?query="&A20), 
 "where Col1 contains 'ip'"), "<ip>|</ip>", "")

0

=INDEX(IMPORTHTML("https://tools.keycdn.com/geo?host="&A20, "table", 1), 1, 2)

0

© www.soinside.com 2019 - 2024. All rights reserved.