Welcome !

 Get 2 For each values & string them together & make an table for them

Author Message

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 2/16/2017
  • Status: offline
Get 2 For each values & string them together & make an table for them Friday, February 17, 2017 12:19 AM (permalink)
         Im trying to get the TextContent from every td tag with index 1 in every tr in
a table with classname "az-facts" index 0 & also every b tag TextContent in the
same table & string them together side by side & create a new line. I can successfully
get the b tag TextContent. How do you do it ? I'd also like to make my own table with
2 columns & a new tr everytime I get both TextContent values. I've been at this for
a while now. Can someone please help ? Any other advice on my code would help me
to, thanks. Here is my code:
Sub GetData

     Set objIE = CreateObject("InternetExplorer.Application")
     objIE.Navigate "https://a-z-animals.com/animals/barracuda/"
   Do While objIE.Busy
     Delay 10

     Set FactsB = objIE.Document.getElementsByClassName("az-facts")(0).getElementsByTagName("b")
     Set TdData = objIE.Document.getElementsByClassName("az-facts")(0).getElementsByTagName("tr")(0).getElementsByTagName("td")(1)

   For Each b in FactsB
     BNde = b.TextContent
   For Each x in TdData
     TdNde = x.TextContent
     bright.InnerHtml = bright.InnerHtml & BNde & space(1) & TdNde & "<br>"

     Set FactsB = Nothing
     Set TdData = Nothing

End Sub
    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 2 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2017 ASPPlayground.NET Forum Version 3.9