+ Reply to Thread
Results 1 to 2 of 2

Extracting webpage source code using VBE

Hybrid View

  1. #1
    Registered User
    Join Date
    04-14-2015
    Location
    US
    MS-Off Ver
    2007
    Posts
    35

    Extracting webpage source code using VBE

    Hello guys, I hope there are people that are smart enough to help me solve my problem...

    I have a list of links.
    Each of the links have a website with an embedded video.
    I would like macros to go to each link and extract the embedded video code from the page's source code and paste it to the cell on the right.

    I wrote a script, which searches for a line that has "/embed/" and then extracts the whole line, which is what I need.
    However, I don't know how to use the script without entering the link to the script manually each time and make the output result to the right of the link.

    Picture:
    Question.PNG

    Excel file:question1.xlsx


    Sub test()
    Worksheets("sheet1").Select
    Range(Cells(1, 1), Cells(12000, 1)) = ""
    meta = "meta itemprop"
    Result = "/embed/"
    Dim str As String
    indi = 2
    Dim inarr As Variant
    Dim outarr As Variant
    Set FinHTTP = CreateObject("Microsoft.xmlHTTP")
    Dim FinRows, FinCols
    urlstring = "http://www.in.com/videos/watchvideo-raabta-title-song-100697232.html#block1"
    FinHTTP.Open "GET", urlstring, False
    FinHTTP.send

    textmess = FinHTTP.responseText
    'MsgBox textmess
    FinRows = Split(FinHTTP.responseText, Chr(10))
    For j = 0 To UBound(FinRows) - 1

    ' Cells(j + 1, 1) = FinRows(j)
    str = FinRows(j)

    If InStr(str, meta) > 0 Or InStr(str, Result) > 0 Then
    Cells(indi, 1) = FinRows(j)
    indi = indi + 1
    End If
    Next j


    End Sub
    Last edited by rolex; 06-07-2017 at 03:48 PM.

  2. #2
    Registered User
    Join Date
    04-14-2015
    Location
    US
    MS-Off Ver
    2007
    Posts
    35

    Re: Extracting webpage source code using VBE

    anyone knows how to solve this problem?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Extract Source code webpage and display in Excelfield
    By martijnrikkert in forum Excel General
    Replies: 0
    Last Post: 02-23-2017, 09:43 AM
  2. [SOLVED] Extract Complete HTML Source code of webpage
    By Naveed Raza in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-16-2016, 02:06 PM
  3. Vba code for using webpage ( Tracking Goods c/ment on webpage)
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2013, 06:03 AM
  4. I need some help extracting data from a specified webpage
    By Aristizabal95 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2013, 07:35 PM
  5. Help in getting to full HTML source code for webpage via Excel VBA
    By stuht in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2013, 05:41 PM
  6. Extracting Data from Webpage
    By Kevin.Antony in forum Excel General
    Replies: 4
    Last Post: 01-06-2012, 02:38 PM
  7. Extracting data from webpage
    By Gramzon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-22-2009, 12:40 PM

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