ImportXML - Google表格但不完整的HTML [英] ImportXML - Google Sheets but incomplete HTML

查看:198
本文介绍了ImportXML - Google表格但不完整的HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

 <!DOCTYPE html> 
< html>
< head>
< meta name =viewportcontent =width = device-width,initial-scale = 1>
< meta http-equiv =Content-Typecontent =text / html; charset = utf-8>
< title>管理控制台< / title>
< link rel =stylesheethref =https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/lumen/bootstrap.min.css>
< link href =https://fonts.googleapis.com/css?family=Montserrat =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上使用inspect打开它时,div id之间的行上有更多信息=root和/ div。我不确定它是否仍然可以使用xpath。

解决方案

IMPORTXML只能通过JavaScript或其他方式访问源代码而不是修改后的DOM这样做,所以IMPORTXML不是获得所需值的工具。


First of all, I'm a newbie and doesn't know programming. I am trying to use importxml on one of my sheets but it doesn't work as it is always returning as an empty cell. When I view the page source of my URL, it only shows this.

<!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>

Whereas, when I open it using inspect on Chrome, there are more information on the line between div id="root" and /div. I am not sure if it something I can still get using xpath. Please see attached pic for what I am seeing.

解决方案

IMPORTXML can only access the source code not the modified DOM by JavaScript or other by other means in contrary as a web browser does, so IMPORTXML isn't the tool the get the required value.

这篇关于ImportXML - Google表格但不完整的HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆