无法从ImportXML获取日期.需要选择 [英] Trouble fetching date from ImportXML. Need options

查看:75
本文介绍了无法从ImportXML获取日期.需要选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google表格. 我正在尝试在此页面上获取预计到达时间: https://www .hapag-lloyd.com/en/online-business/tracing/tracing-by-booking.html?blno = HLCUEUR181027806#

Using Google Sheets. I'm trying to fetch the ETA date on this page: https://www.hapag-lloyd.com/en/online-business/tracing/tracing-by-booking.html?blno=HLCUEUR181027806#

将来,我将使用其他blno,因此ETA将根据blno(提单号)而变化.将来,blno将来自专栏.

In the future, I will be using different blno's, so the ETA will change based on the blno (bill of lading number). In the future, blno will come from a column.

我使用了标准的网页检查方法来确定所需元素的xpath如下: //* [@@ id ="ext-gen156"]

I used the standard web-page inspection methods to determine that the xpath for the element that I want is the following: //*[@id="ext-gen156"]

这是ETA日期的XPath,在这种情况下,当您访问页面时为12/4/2018.

This is the XPath for the ETA date, which in this case is, 12/4/2018, when you visit the page.

我在E4中填充了: https://www .hapag-lloyd.com/en/online-business/tracing/tracing-by-booking.html?blno = HLCUEUR181027806#

I populated E4 with: https://www.hapag-lloyd.com/en/online-business/tracing/tracing-by-booking.html?blno=HLCUEUR181027806#

然后我用以下命令填充E5: //* [@@ ="=" ext-gen156]

And I populated E5 with: //*[@id="ext-gen156"]

然后公式"= importxml(E4,E5)"给出结果"N/A"(在F4上).

Then formula "=importxml(E4,E5)" gives result "N/A" (on F4).

如果我将E4更改为 https://en.wikipedia.org/wiki/List_of_T_postal_codes_of_Canada

If I change E4 to https://en.wikipedia.org/wiki/List_of_T_postal_codes_of_Canada

和 E5至 //* [@@ ="=" mw-content-text]/div/table [1]/tbody/tr [1]/td [6]/span/a [1]

and E5 to //*[@id="mw-content-text"]/div/table[1]/tbody/tr[1]/td[6]/span/a[1]

它起作用了……它从不同的网站上获得了不同的信息.

it works... it gets a different piece of information from a different website.

我怀疑上述第一种情况出现问题的原因是它不是静态页面.也许它仅适用于静态页面.

I suspect that the reason I am having problem for the first scenario described above is that it is not a static page. Maybe it only works for static pages.

我试图了解XPath的含义,但这也很令人困惑.如果有人给我指出一个很好的解释,那也将很有价值.例如,以下文档说您应该使用."选择当前节点.在我尝试使用XPath的情况下,当前含义是什么?似乎没有道理.

I tried to understand what XPath means, but it is also very confusing. If someone were to point me to a good explanation of this, that would also be valuable. For example, the following document says that you should use "." to select the current node. What does current mean in the context in which I am trying to use XPath? Didn't seem to make sense.

https://www.w3schools.com/xml/xpath_syntax.asp

任何对战略的指导将不胜感激.我可能会做错所有的事情.我也与Hapag-Lyod联系,以查看他们是否有RSS feed,尽管我也是新来的人.

Any guidance in strategy would be appreciated. I could be going about it all wrong. I contacted Hapag-Lyod also, to see if they have an RSS feed, although I am new to that as well.

那么,对于那些已经做了类似工作的专家来说,解决该项目的可能方向是什么?

So, for the experts out there that have done something like this, what would be possible directions to tackle this project?

我正在倒退.我有一个目标,但我不了解所有技术.我的背景更多是客户端应用程序,因此在Web应用程序方面遇到研究麻烦.希望我足够详细,但如果没有,请让我知道如何改善该问题,我将很乐意这样做.

I'm working backwards. I have a goal, but I don't know all the technology. My background is more of client apps, so I am having research trouble when it comes to web applications. Hope I was detailed enough, but if not, let me know how to improve the question and I will be happy to do so.

推荐答案

我们开始使用名为AutoIt的工具. 这将是解决此问题的正确工具.

We are starting to play with a tool called AutoIt. This is going to be the right tool for this problem.

这篇关于无法从ImportXML获取日期.需要选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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