【问题标题】:ImportXML - Google Sheets but incomplete HTMLImportXML - Google 表格但 HTML 不完整
【发布时间】:2016-11-13 22:15:13
【问题描述】:

首先,我是新手,不懂编程。我试图在我的一张纸上使用 importxml 但它不起作用,因为它总是作为一个空单元格返回。当我查看我的 URL 的页面源时,它只显示这个。

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <title>Management Console</title>
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/lumen/bootstrap.min.css">
   <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
</head>
<body>
<div id="root">
</div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCtv3S4sKtUtwBwvvkQuGbq3HrzGftdJpc&libraries=geometry"></script>
<script src="/bundle.js"></script>
</body>
</html>

然而,当我在 Chrome 上使用检查打开它时,在 div id="root" 和 /div 之间的行上有更多信息。我不确定我是否仍然可以使用 xpath 获得它。请参阅附件图片了解我所看到的内容。

【问题讨论】:

    标签: html xpath web-scraping google-sheets google-sheets-importxml


    【解决方案1】:

    IMPORTXML 只能通过 JavaScript 或其他方式访问源代码而不是修改后的 DOM,与 Web 浏览器相反,因此 IMPORTXML 不是获取所需值的工具。

    【讨论】:

      猜你喜欢
      • 2019-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-02
      • 2018-03-28
      • 2019-03-15
      相关资源
      最近更新 更多