getelementsbytagname

SelectNodes and GetElementsByTagName

大憨熊 提交于 2019-12-12 09:44:21
问题 what are main differences between SelectNodes and GetElementsByTagName. 回答1: SelectNodes is a .NET/MSXML-specific method that gets a list of matching nodes for an XPath expression. XPaths can select elements by tag name but can also do lots of other, more complicated selection rules. getElementByTagName is a DOM Level 1 Core standard method available in many languages (but spelled with a capital G in .NET). It selects elements only by tag name; you can't ask it to select elements with a

VBA: not able to pull value within <input> tag using getelementsbyTagname().Value

喜你入骨 提交于 2019-12-12 04:44:34
问题 This is my first post on stackflow :) I've been Googling VBA knowledge and writing some VBA for about a month. My computer info: 1.window 8.1 2.excel 2013 3.ie 11 My excel reference Microsoft Object Library: yes Microsoft Internet Controls: yes Microsoft Form 2.0 Object library: yes Microsoft Script Control 1.0: yes Issue: I was trying to retrieve data from internet explorer automatically using VBA. I would like to retrieve the value within an input tag from a id called "u_0_1" which is under

getElementsByTagName does not seem to work

别说谁变了你拦得住时间么 提交于 2019-12-12 03:11:58
问题 Can someone please explain why my code is not working !! When I get the element By Id it works perfectly fine. But the same method with getElementsByTagName() does not. Also if I use querySelector(), it works. However if I use querySelectorAll() the same error returns. test.html:15 Uncaught TypeError: Cannot set property 'color' of undefined here is my code: <DOCTYPE! html> <html> <head> </head> <body> <h1>Hello World</h1> <p id="par">Hello World</p> <script> var par = document.getElementById

Filter getElementsByTagName list by option values

拜拜、爱过 提交于 2019-12-12 02:18:32
问题 I'm using getElementsByTagName to return all the select lists on a page - is it possible to then filter these based upon an option value, ie of the first or second item in the list? The reason is that for reasons I won't go into here there are a block of select lists with number values (1,2,3,4,5 etc) and others which have text values (Blue and Black, Red and Black etc) and I only want the scripting I have to run on the ones with numerical values. I can't add a class to them which would more

Access XML data via javascript

泪湿孤枕 提交于 2019-12-11 23:59:03
问题 How can I get the value of my xml data using a javascript. Im accessing my xml file on my domain, and view it on the client side. my.xml <usr> <uid trk="1234"> <getThis>kdzbnya</getThis> </uid> </usr> I want to get the value of "getThis" sample.js function alertThis(){ var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); var xmlFile = "my.xml"; xmlDoc.async="false"; xmlDoc.load(xmlFile); xmlObj=xmlDoc.documentElement; try { var v = ""; $.each(xmlObj.childNodes, function(i, valThis) { if

How to import a Tag from the first file to all Tag In the second file

孤街醉人 提交于 2019-12-11 18:45:33
问题 How to import a Tag "mohamed" From the first file to all TAG ahmed In the second file <?xml version="1.0" encoding="UTF-8"?> <map xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> <!-- created with Free Online Sitemap Generator www.xml-sitemaps.com --> <mohamed>stackover flow</mohamed> </map> My Xml-2 file is <?xml

I can't remove all the paragraphs in the page via JavaScript

时光怂恿深爱的人放手 提交于 2019-12-11 11:47:43
问题 <!DOCTYPE html> <meta charset="utf-8"> <title>An HTML5 Document</title> <p>1 <p>2 <p>3 <p>4 <p>5 <p>6 <p>7 <p>8 <p>9 <p>10 <p>11 <p>12 <script> // When the document is clicked, codes below should remove all the paragraphs in the page. // There are 12 paragraphs in the page, but codes below can just remove 6 of them. document.addEventListener('click', function () { var i, allParagraphElements = document.getElementsByTagName('p'); console.log('allParagraphElements.length: ' +

VBA .innertext using getelements*, cannot locate areas in html code

这一生的挚爱 提交于 2019-12-11 07:36:57
问题 I am trying to create a macro to get the innertext from an internal webpage. I am not sure on how to properly locate the where the text is and would appreciate some direction and possibly some explanation on the approach. I have tried numerous variations of using the getelementsby/tagname/classname to no avail. im not sure i understand the logic behind locating the areas after using the inspection function. Var = ie.document.getelementClassName("sections").getElementsByTagName("table").Item(0

How can I refine this Javascript code to refine it so it only work on links from images (and NOT links from text)

耗尽温柔 提交于 2019-12-11 05:46:41
问题 I want to make some refinement to some code from a previous question: // the new base url var base = ' https://www.example.co.uk/gp/wine/order?ie=UTF8&asin='; var links = document.getElementsByTagName('a'); for(var i = 0;i < links.length;i++){ // check each link for the 'asin' value var result = /asin=([\d\w]+)/.exec(links[i].getAttribute('href')); if(result){ // make a new url using the 'base' and the 'asin' value links[i].setAttribute('href', base+result[1]); } } Now, instead of it acting

GetelementsByTagName seems to not work properly

ぃ、小莉子 提交于 2019-12-11 05:18:22
问题 this question sounds stupid but how come when I use the function GetElementsByTagname("frame") , it only returns 3 as a length and not 5 as I expected ? Here is the HTML of the webpage where I counted 5 times the apparition of the tagname "frame" but when I ask for the length in VBA I get 3... My observations : 1) You can see that 3 is the number of main frames (top_navigation, contentframe, dummyframe) 2) If I try to access to one of the mainframes via getelementbyname, it works but if I try