- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我花了很长时间试图解决这个问题。任何人都可以帮我解决这个问题。
我完全按照这个 youtube 教程进行操作: http://www.youtube.com/watch?v=3Huh44nsZTw
当我完成输入时:
describe("Experimentation", function() {
var elem;
beforeEach(function() {
elem = $('<div id="container"><p>Hello World</p></div>');
});
it("allows us to search with CSS selectors", function() {
expect(elem).toBe('#containers'); // Problem happened here!!!!!!!
});});
输出结果:
Experimentation allows us to search with CSS selectors
Expected { 0 : HTMLNode, length : 1 } to be '#containers'.
Error: Expected { 0 : HTMLNode, length : 1 } to be '#containers'.
at stack (http://localhost:8888/__jasmine__/jasmine.js:1293:17)
at buildExpectationResult (http://localhost:8888/__jasmine__/jasmine.js:1270:14)
at Spec.Env.expectationResultFactory (http://localhost:8888/__jasmine__/jasmine.js:484:18)
at Spec.addExpectationResult (http://localhost:8888/__jasmine__/jasmine.js:260:46)
at Expectation.addExpectationResult (http://localhost:8888/__jasmine__/jasmine.js:442:21)
at Expectation.toBe (http://localhost:8888/__jasmine__/jasmine.js:1209:12)
at Object.<anonymous> (http://localhost:8888/__spec__/experimentationSpec.js:9:16)
at attemptSync (http://localhost:8888/__jasmine__/jasmine.js:1510:12)
at QueueRunner.run (http://localhost:8888/__jasmine__/jasmine.js:1498:9)
at QueueRunner.execute (http://localhost:8888/__jasmine__/jasmine.js:1485:10)
最佳答案
elem = $('<div id="container"><p>Hello World</p></div>');
expect(elem).toBe('#containers');
您正在将容器与容器进行比较。请注意额外的“s”。
关于Javascript: Jasmine 错误:预期{0:HTMLNode,长度:1}为 '#containers',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24845610/
我应该如何添加到我的项目 HTMLParser、htmlnode、...?因为添加(.h和.m)但是我得到如下错误: 找不到 libxml/HTMLparser.h 文件! 发送。 最佳答案 您必须在
我正在使用 HTML Agility Pack 来解析和转换 HTML 文件,但由于索引参数,在尝试创建新的 HTMLNode 时出现异常“项目已添加”。 HtmlNode node1 = new H
我正在尝试使用 HtmlAgilityPack 来查找网站中的元素。我的问题如下: 我创建了一个 Windows 8 通用应用程序 (c#) 使用我添加的 NuGet 管理器: using Syste
我使用 HtmlAgilityPack 来解析 webbrowser 控件的 html 文档。我能够找到我想要的 HtmlNode,但是在获得 HtmlNode 之后,我想在 WebbrowserCo
如何知道 HtmlNode我正在使用的是 ?我知道 NodeType是一个 Element但是你如何确定它是否是 如果您需要更多信息,请告诉我。 最佳答案 你可以这样检查,只需要使用Name属性:
我是 JavaScript 新手,当我使用 DOM 模型时,当我想要显示 HTML childNodes 中的所有 nodeName 时,我感到很困惑。当我有一个 head 标签并且删除完整的 hea
上下文: 我正在解析关于 this service 的查询结果,但结果的 HTML 是一团糟。 我的目标是构建一个“KeyValue”对,每个“属性和值”都显示为该查询的结果。 目前我脑子里只有一种方
我正在尝试为给定的行/字符位置(例如第 5 行,第 12 个字符)找到相应的 HtmlNode。我查看了帮助文档,但不太确定它是否可用。 这可以在 Html Agility Pack 中实现吗? 编辑
我正在创建一个自动将数据插入 html 输入标签的应用程序。我有用于特定标记的 xPath,例如“/html/body/form/div/div[2]/div/div/input”,我在 HtmlAg
如果“SelectNodes”返回 NULL,我如何在下面的 foreach 循环中捕获 NullReferenceException 错误? 我在 stackoverflow 上进行了搜索,发现提到
我使用默认的 .net WebBrowser 创建了一个 HTMLElement picker (DOM)。 用户可以通过单击选择(选择)一个 HTMLElement。 我想获取HTMLElement
我花了很长时间试图解决这个问题。任何人都可以帮我解决这个问题。 我完全按照这个 youtube 教程进行操作: http://www.youtube.com/watch?v=3Huh44nsZTw 当
我是一名优秀的程序员,十分优秀!