getelementsbytagname

Powershell, ie9 and getElementById

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use successfully a script for web automation from this site: heise web automation I know it is in german, but perhaps someone can help. The important part of the e-plus website: Benutzername: Passwort: the part of the Powershell script: $script:ie = New-Object -comobject InternetExplorer.Application $ie.visible = $false $ie.silent = $true # $ie.Navigate("https://www.eplus.de/login/login.asp") LadenWarten(1) # $ie.Document.getElementById("IDToken1OL").value = $user $ie.Document.getElementById("IDToken2OL").value = $passwort $ie.Document

Using variable outside of ajax callback function

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the best to use global variables outside of a callback function? var icon; $(function(){ $.get('data.xml', function(xml){ icon = xml.documentElement.getElementsByTagName("icon"); //this outputs a value console.log(icon); }); //this is null //How can this maintain the value set above? console.log(icon); }); 回答1: The code you have provided is perfectly valid -- and, in fact, icon does "maintain" it's value. The problem, likely, is that get() runs asynchronously -- only calling the anonymous function after 'data.xml' has been fully

How can I get an HtmlElementCollection from a WPF WebBrowser

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My old WinForm application used HtmlElementCollection to process a page HtmlElementCollection hec = this.webbrowser.Document.GetElementsByTagName("input"); In WPF WebBrowser, there are several things that are different. For example this.webbrowser.Document does not have any method called GetElementsByTagName Therefore my code is unable to get an HtmlElementCollection 回答1: You need to add reference to Microsoft.mshtml and then you need to cast document as mshtml.HTMLDocument . After you do that you should be able to use getElementsByTagName()

does document.getElementsByTagName work in vbscript?

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Well, it works, it just doesn't produce anything worthwhile: elems = document.getElementById("itemsTable").getElementsByTagName("TR") for j = 0 to ubound(elems) - 1 ' stuff next Well, that won't work, apparently elems is an object, not an array like you'd get in that fancy javascript . I'm stuck with vbscript though. So what do I do to iterate all the rows in a table in vbscript? Edit: Yes, it's vbscript and it sucks. I don't have a choice here, so don't say "Use jQuery!!". 回答1: As you have correctly stated getElementsByTagName does not

InvokeMember(“click”) webBrowser help

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to automate a web page via the weBrowser and the button that i'm trying to click has no ID only a value. here's the html code for it: Accept I can't useGetElementById as the button has no ID. If I do HtmlElement goButton = this.webBrowser1.Document.All["Accept"]; goButton.InvokeMember("click"); My script stops showing a nullreference error highlighting the "goButton.InvokeMember("click");" If I do var inputControls = (from HtmlElement element in webBrowser1.Document.GetElementsByTagName("input") select element).ToList();

ReferenceError: document is not defined (in plain JavaScript)

匿名 (未验证) 提交于 2019-12-03 01:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I get the a "ReferenceError: document is not defined" while trying to var body = document.getElementsByTagName("body")[0]; I have seen this before in others code and didn't cause any trouble. Why is it now? The companied HTML page is just a div inside the body. Next the code is the following: (function(){ var body = document.getElementsByTagName("body")[0]; function Question(question, choices, correctAns) { this.question = question; this.choices = choices; this.correctAns = correctAns; } Question.prototype.checkAns = function(givenAns){ if

TypeError getElementsByTagName is not a function issue

匿名 (未验证) 提交于 2019-12-03 00:50:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm having trouble getting to the source of this problem. Basically the error message I am getting in my console is: TypeError: $(...).getElementsByTagName is not a function When I click through to the line it is occuring on it is here: var inputs = $('directoryresults').getElementsByTagName('input'); I'm not sure why this is happening as I have included jQuery in the header of the page itself: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1

遍历ul下的li,点击弹出li的索引

匿名 (未验证) 提交于 2019-12-02 23:49:02
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <ul id='ul'> <li>点我啊</li> <li>点我啊</li> <li>点我啊</li> <li>点我啊</li> <li>点我啊</li> </ul> </body> <script> // 第一种 var ul = document.getElementById('ul') ul.addEventListener('click',function(e) { var lis = ul.getElementsByTagName('li') for (let i = 0; i < lis.length; i++ ) { if (e.target == lis[i]) { alert(i+1) } } }) // 第二种 // var lis = document.getElementsByTagName('li') //

08-tab切换案例实现

匿名 (未验证) 提交于 2019-12-02 23:38:02
< ! DOCTYPE html > < html > < head lang = "en" > < meta charset = "UTF-8" > < title > < / title > < style > * { margin : 0 ; padding : 0 ; } ul { list - style - type : none ; } . box { width : 400 px ; height : 300 px ; border : 1 px solid #ccc ; margin : 100 px auto ; overflow : hidden ; } . hd { height : 45 px ; } . hd span { display : inline - block ; width : 90 px ; background - color : pink ; line - height : 45 px ; text - align : center ; cursor : pointer ; } . hd span . current { background - color : purple ; } . bd li { height : 255 px ; background - color : purple ; display : none ; }

html5 video getElementsByTagName() 和 getElementsByClassName() 与 getElementById() 获取实时播放时间的区别

匿名 (未验证) 提交于 2019-12-02 20:32:16
<video class="a" id="b"> 下面通过 getElementsByTagName() 和 getElementsByClassName() 与 getElementById() 取值的区别 打印当前播放时间 getElementsByTagName() 和 getElementsByClassName()的写法 var vid = document.getElementsByName("video"); console.log(vid [0] .currentTime); var vid = document.getElementsByClassName("a"); console.log(vid [0] .currentTime); getElementById()的写法 var vid = document.getElementById("b"); console.log(vid.currentTime); 文章来源: https://blog.csdn.net/v791106444/article/details/89026043