Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic Webelement Value
#3
Not Solved
novemberrain81:

'' using finance.yahoo.com
' You needed to look in the source code.

Code:
' the field appears to have an html id value = "yfs_l84_symbol", where symbol is nflx, ibm or....
'symbol = "IBM"
symbol = "NFLX"
browserName = symbol&": .*"
pageTitle = symbol&": .*"

Set oDesc =description.Create()
oDesc("micclass").value = "WebElement"
oDesc("html tag").value = "span"
oDesc("html id").value = "yfs_l84_"&LCase(symbol)

Set oAll = browser("name:="&browserName).page("title:="&pageTitle).childObjects(oDesc)
cnt = oAll.count
print "count = " & cnt

For  i = 0 to oAll.count - 1
    'If oAll.item(i).GetROProperty("html id") = "yfs_l84_nflx" Then
    If oAll.item(i).GetROProperty("html id") = "yfs_l84_"&LCase(symbol) Then
        print oAll.item(i).GetROProperty("html id") & " :: " & oAll.item(i).GetROProperty("outertext")
    End If
    'print oAll.item(i).GetROProperty("html id") & " :: " & oAll.item(i).GetROProperty("outertext")
Next

Results:
count = 1
yfs_l84_ibm :: 186.13
count = 1
yfs_l84_nflx :: 309.17
hth,

Parke
Reply


Messages In This Thread
Dynamic Webelement Value - by Novemberrain81 - 08-26-2013, 03:24 AM
RE: Dynamic Webelement Value - by GregHicks - 08-26-2013, 04:16 PM
RE: Dynamic Webelement Value - by Parke - 09-30-2013, 11:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to identify a Dynamic WebElement? PreethiJoshi 1 5,537 05-03-2018, 04:08 PM
Last Post: Ankur
  Identifying radio buttons with same html ID but dynamic webelement properties manishac 12 13,751 05-03-2012, 06:27 AM
Last Post: manishac
  unable to extract dynamic object values-webelement object naniblr9 1 3,300 11-10-2009, 12:20 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 2 Guest(s)