Tag: dom

使用VBA将特定的子节点从HTML表中提取到excel

我想在FDA节点中提取第5个孩子,然后点击IMG。 我的解决scheme迄今只提取第二个元素。 任何帮助将不胜感激。 <TD>Proxy to Inter</TD> <TD>15/03/2017 7:19:18 AM</TD> <TD>15/03/2017 7:19:18 AM</TD> <TD>2</TD> <TD>10</TD> <TD>false</TD> <TD></TD></TR> <TR class=white><TD>FDA</TD> <TD>Data</TD> <TD>24/07/2017 1:21:59 PM</TD> <TD>25/07/2017 9:42:43 AM</TD> <TD>2</TD> <TD>10</TD> <TD>false</TD> <TD><IMG onclick="Trail( style="CURSOR: hand" alt="" src="/images/task.gif"></TD></TR> 我的VBA代码到目前为止: sText = "" Found = False Set inputCollection = HTMLDoc.getElementsByTagName("td") For Each inputElement In inputCollection If Found = True Then […]

VBA如果<object>是Nothing

我想testing一个对象,看它是否不存在。 如果它不存在,我只想显示一个MsgBox(或者在单元格A1中写入错误)。 香蕉不存在于这个XML中。 <?xml version="1.0"?> <catalog> <book id="Adventure"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> <price>44.95</price> </book> <book id="Adventure"> <author>Ralls, Kim</author> <title>Midnight Rain</title> <price>5.95</price> </book> <book id="Adventure"> <author>Boal, John</author> <title>Mist</title> <price>15.95</price> </book> <book id="Mystery"> <author>Ralls, Kim</author> <title>Some Mystery Book</title> <price>9.95</price> </book> </catalog> testing代码: Sub mySub() Dim XMLFile As Variant Dim Author As Object Dim athr As String, […]

在Excel VBA中,如何检索单元格内的文本格式

在Excel VBA中,我想要检索单元格的文本以及每个单词的格式。 例如,单元格A1具有“ 示例 文本 ”的值。 Range(“A1”)。Value属性只返回纯文本(即“示例文本”)。 我想要的是一个对象,它给了我一些像“</ i> <b>文本</ b>”的东西。 Excel DOM中的对象是什么?

DOMDocument :: load – PHP – 获取属性值

我努力从ss:ExpandedColumnCount="3"中获得3的值 <Table ss:ExpandedColumnCount="3" ss:ExpandedRowCount="2" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="65" ss:DefaultRowHeight="15"> <Row> <Cell><Data ss:Type="String">cat</Data></Cell> <Cell><Data ss:Type="String">dog</Data></Cell> <Cell><Data ss:Type="String">horse</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">ve</Data></Cell> <Cell><Data ss:Type="String">as</Data></Cell> <Cell><Data ss:Type="String">fs</Data></Cell> </Row> <Row> <Cell><Data ss:Type="String">ve</Data></Cell> <Cell><Data ss:Type="String">as</Data></Cell> <Cell><Data ss:Type="String">fs</Data></Cell> </Row> </Table> 我正在使用XLS文件在PHP中使用DOMDocument :: load。 任何帮助将不胜感激。 干杯

Excel VBA – 当button具有相同的名称时,单击一个button

我有一个网站,其中所有的button都有相同的类名,button的唯一区分部分是“data-dojo-attach-point”。 我正在尝试点击该button或select该字段并input值。 <div class="btn btn-default" type="button" data-dojo-attach-point="searchAddress">Search</div> <div class="btn btn-default" type="button" data-dojo-attach-point="buildToAddress">Build to Address</div> 即像这样 Set element = .document.getElementsByClassName("btn btn-default") element.Item(0).Click 有谁知道我可以如何select正确的button来点击? 提前致谢!

Excel VBA:从在线HTML表格获取内容

任何人都可以请求让我看看VBA代码的一部分,这将从这个例子在线HTML表格中得到文本“你好”? 第一个节点将被他的ID(id =“something”)find。 … <table id="something"> <tr> <td><TABLE><TR><TD></TD></TR><TR><TD></TD></TR></TABLE></td><td></td> </tr> <tr> <td></td><td></td><td>hello</td> </tr> … 我认为这将是像child->sibling->child->sibling->sibling->child ,但我不知道确切的方式。 编辑更新的代码标签是大写。 所以如果我使用getElemenetsById("something").getElemenetsByTagName('tr')它只能得到两个tr标签集合,或四个(标签是更深的孩子)?

读取XML属性VBA

我试图获取VBA中单个节点的属性,但无法使用DOM来pipe理它 XML如下所示: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <GetUserInfoResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/directory/"> <GetUserInfoResult> <GetUserInfo> <User ID="16" Name="" LoginName="login" Email="" Notes="" IsSiteAdmin="False" IsDomainGroup="False" /> </GetUserInfo> </GetUserInfoResult> </GetUserInfoResponse> </soap:Body> </soap:Envelope> 我基本上只是试图获得ID属性的值。 任何帮助,将不胜感激。