如何保留一个空白单元格,而不用Importxml跳过它? [英] How to leave a blank cell and not skip it with Importxml?

查看:62
本文介绍了如何保留一个空白单元格,而不用Importxml跳过它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我有一个导入xml代码:

Basically I have an import xml code:

=IMPORTXML("https://www.example.com/listings.php?","//*[@id='listings']//*[@class='address']")

它会连续吐出该值.

但是,如果(div/span)类中的文本为空,则会跳过该文本并在下面的单元格中显示下一个文本.

However if the text within the (div/span) class is empty it just skips over it and shows the next one in the cell below.

即使具有该类的div存在,我也不希望它跳过空白文本,即使它内部没有文本也是如此.而是创建一个空白单元格,以免与它旁边的列的值混淆.

I don't want it to skip over blank text if the div with that class exists, even if it has no text inside. But rather create a blank cell so it doesn't mess with the values of the column beside it.

这怎么可能?

推荐答案

因此,如果这是您自己的网站,我发现的唯一解决方案是将& nbsp; 添加到所有空divs/跨越还是我们

So if this is your own site, the only solution I found was to add   into all the empty divs/spans or w.e

这对我有用,并留下了一个与它旁边的列匹配的空白单元格.

This worked for me and left a blank cell which matched the column beside it.

请记住,如果您的内容是动态刷新或更改的,则需要创建一个参数以不更改内容,否则即使您有空白,它也不会与列匹配.

Just keep in mind that if your content is dynamically refreshing or changing, you'll need to create a param to not change the content, otherwise it won't match the columns, even though you have the white space.

这篇关于如何保留一个空白单元格,而不用Importxml跳过它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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