怎么获取这个网页的这个数值呢?

boxsys 2005-03-27 04:26:43
网页上有<input type="checkbox" name="ABC" value="1" checked>答案1

这样的内容,如何获取<input>标签后的内容,即“答案1”,我已经获得Document对象,但是我获得InnerText是空值,不过似乎对input这个标签没有效果。

我使用MSHTML.HTMLDocument操作网页
...全文
126 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
TechnoFantasy 2005-03-28
  • 打赏
  • 举报
回复
getAdjacentText Method

--------------------------------------------------------------------------------

Returns the adjacent text string.

Syntax

text = object.getAdjacentText(sWhere)
Parameters

sWhere Required. String that specifies where the text is located using one of the following values: beforeBegin Text is returned immediately before the element.
afterBegin Text is returned after the start of the element but before all other content in the element.
beforeEnd Text is returned immediately before the end of the element but after all other content in the element.
afterEnd Text is returned immediately after the end of the element.


Return Value

Returns the first adjacent text string.

Example

  • 打赏
  • 举报
回复
楼主,因为input都是这样的<input type="" value="" />故不应该是innertext or innerhtml
boxsys 2005-03-27
  • 打赏
  • 举报
回复
MSDN的,看来似乎就这几个
sWhere Required. String that specifies where the text is located using one of the following values:

beforeBegin Text is returned immediately before the element.
afterBegin Text is returned after the start of the element but before all other content in the element.
beforeEnd Text is returned immediately before the end of the element but after all other content in the element.
afterEnd Text is returned immediately after the end of the element.
boxsys 2005-03-27
  • 打赏
  • 举报
回复
呵呵,自己弄出来了:object.getAdjacentText("afterEnd")

但是对getAdjacentText的参数不明白,有谁能说一说参数有哪些呢,是什么作用?
我已经知道有“afterEnd”和“beforeBegin”这两个参数,但是意思还是不明白

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧