0

i can't manage to extract certain links from a website with css. i don't really know css yet either and am just finding my way around it. i have 2 questions one specific how to find the element, and at the end again how to examine the element in css.

1.

Inspection of the site with markers

enter image description here

i am trying to get the two links marked in green, as marker i would like to use either the red marked link text or above it.

my attempted code:

    Set Elements = GC.FindElementsByCss("table.TABLE tbody tr td p iframe ")
    a = 0
    For Each Element In Elements
         ReDim Preserve href(a) As String
        href(a) = Element.Attribute("innerText")
        a = a + 1
    Next Element

can i somehow examine the elements in vba? if i know what is stored in them, i could search for the desired value under Value and then use the expression. I think under Watches I once had the possibility to see all the different values for an element like innerText, href, outerhtml, innerhtml and so on.

In VBA Watches at the moment i only see a small overview

enter image description here

braX
  • 11,506
  • 5
  • 20
  • 33
obo
  • 1
  • Would answering your first question _how to find the element_ be sufficient? Currently your question is too broad as per Stackoverflow standards. – undetected Selenium Dec 22 '21 at 12:15
  • definitely yes. – obo Dec 22 '21 at 13:45
  • https://stackoverflow.com/a/60914156 – QHarr Dec 22 '21 at 15:33
  • But @QHarr my iframe has no attribute like id, name, class or tag – obo Dec 22 '21 at 15:48
  • You can use FindElementsBy and then index into the returned WebElements collection e.g. select the first element (iframe) or second .... after selecting all iframes within current document. – QHarr Dec 22 '21 at 16:01
  • You can get the links that have the class ``loadbutton`` and then you search for the links that have ``LinkText``. – Elio Fernandes Dec 22 '21 at 16:10
  • ok i was able to get three elements with "Set Elements = GC.FindElementsByCss("iframe")". // but from then on I don't really get on with all my attempts. // after some trial and error I found "innerHTML" and with href(a) = Element.Attribute("innerHTML") I get three entries: "", "loading . . ",loading . ." With GC.FindElementsByCss("iframe a.loadbutton")" i get no elements. also attempts like "GC.FindElementsByCss("iframe html body a[class='loadbutton']")" failed ith zero elements – obo Dec 28 '21 at 16:02
  • The url that you're using is public? If it is, can you share it? – Elio Fernandes Dec 28 '21 at 21:49
  • yes the link is "public" but rather in the gray area. i have "hidden" it behind a bit.ly link so that everyone can decide for themselves after the warning beforehand. It is a download page from which a tried to get the ddl.to link. https://shorturl.at/fpwEP (shorturl works here, and bit.ly which is blocked here warns) – obo Dec 29 '21 at 13:02

0 Answers0