Welcome Guest Search | Active Topics | Sign In | Register

Tag attribute values rescue through ".getElementsByName()" Options
Prequena84
Posted: Friday, July 9, 2021 11:00:07 AM
Rank: Advanced Member
Groups: Member

Joined: 5/10/2021
Posts: 43
Hello, good day, support gentlemen, how are you? I have a question, I am learning how to rescue values from the tags and I have a question, I am using this code to rescue the elements by the name of the tag based on their position:

Code: Visual Basic.NET
WebView1.GetDOMWindow.document.getElementsByTagName("A").ElementAt(12).Item("href")



and with a For I can read the Index of the position, but I need to repeat this action with the property:

WebView1.GetDOMWindow.document.getElementById("")


Now the value I need to enter is the Attribute name or Attribute Value?

This would be an example of the label in which I am going to rescue a value:



Code: HTML/ASPX
<span class="price-tag-symbol" itemprop="priceCurrency">UF</span>



Code: Visual Basic.NET
Dim Test_Attrbute as String = WebView1.GetDOMWindow.document.getElementsByName("itemprop").ElementAt(0).innerText



and this code gives me an error of type index not found, now it doesn't work for me as the property:


Code: Visual Basic.NET
WebView1.GetDOMWindow.document.getElementsByTagName("SPAN").ElementAt(125).innerText



With this code if it works for me, now it may well be that I need to do something else in the property ".getElementsByName"
What is not taking into account?

I appreciate any clarification that helps me to correct the error and improve, while I will continue studying options 1 to 1 and testing.
eo_support
Posted: Sunday, July 11, 2021 5:22:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

You need to use JavaScript to do this. You have had similar question before like this and we have already gone through that before.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.