Results 1 to 4 of 4

Using VBA to pull data from a youtube search (HTML)

Threaded View

  1. #1
    Registered User
    Join Date
    04-18-2015
    Location
    Provo, Utah
    MS-Off Ver
    365
    Posts
    3

    Using VBA to pull data from a youtube search (HTML)

    Hello! I am new to VBA, and I am having a hard time figuring out how to move forward with this code that I am working on. I have excel set up to create a custom search URL based on what I am looking for, and I have that in cell(2,2). I have my code set up to use that search URL, but I can't figure out how to pull the links I need (they are all tagged with "href" in the HTML code) and put them in a column back in my excel sheet. Below is my code thus far, any suggestions?


    Sub youtubesearch()
    Dim myitem As String, myie As Object, myloop As Object, myelement As Object
    myitem = Range("c2").Value
    Set myie = CreateObject("internetexplorer.application")
    myie.navigate Cells(2, 2)
    While myie.busy = True
    Wend
    
    Set myelements = myie.document.getelementsbytagname("href")
    For Each myloop In myelements
    If myloop.Name = "q" Then: myloop.Value = myitem
    If myloop.Value = "search" Then: myloop.Click: Exit For
    Next myloop
    myie.Visible = True
    
    
    End Sub
    Last edited by alansidman; 04-18-2015 at 03:33 PM. Reason: code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to search for data on one sheet and pull it over to another.
    By samdegg in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-22-2013, 03:27 PM
  2. Pull data from HTML tag which is unique (tag within a tag)
    By gochel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-21-2013, 08:54 PM
  3. Pls HELP: Need macro to pull data off PDF/HTML files and arrange in rows
    By ruriimasu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2012, 01:47 AM
  4. Import/pull data from html code into excel
    By emoandy05 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2012, 01:39 PM
  5. pull data to HTML from excel table
    By yrndtn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2010, 04:11 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1