+ Reply to Thread
Results 1 to 11 of 11

How to extract web data into a temporary file that would be used as input variables

  1. #1
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    How to extract web data into a temporary file that would be used as input variables

    Hi all,

    I would like to download all stocks' ticker from below web page in a temporary file that would be used for other processes later, but when I view the HTML code (the red below is examples of 2 stocks, ticker 00001 and 00002), I don't know how to tell vba to distinguish each stock as they are seemingly sharing the same tagname and class. Another question is what the code is when create a temp file to store the list of stocks ticker. Please advise me how to solve this problem. Thanks
    http://www.hkexnews.hk/sdw/search/st...gDate=20141011
    <TR valign="Top" class=TableContentStyle2><TD align=Center>00001</TD><TD nowarp=nowarp align=left><a href=# onClick="ssc('00001','CHEUNG KONG (HOLDINGS) LIMITED');"><span class="arial11grey">CHEUNG KONG (HOLDINGS) LIMITED</span> </a></TD></TR>
    <TR valign="Top" class=TableContentStyle1><TD align=Center>00002</TD><TD nowarp=nowarp align=left><a href=# onClick="ssc('00002','CLP HOLDINGS LIMITED');"><span class="arial11grey">CLP HOLDINGS LIMITED</span> </a></TD></TR>

  2. #2
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: How to extract web data into a temporary file that would be used as input variables

    Could anyone give me a hand?

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to extract web data into a temporary file that would be used as input variables

    what info are you trying to get from this?
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: How to extract web data into a temporary file that would be used as input variables

    Hi abousetta, both stock code and stock name
    Quote Originally Posted by abousetta View Post
    what info are you trying to get from this?

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to extract web data into a temporary file that would be used as input variables

    so you only want:

    00001 CHEUNG KONG (HOLDINGS) LIMITED

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to extract web data into a temporary file that would be used as input variables

    This is what it looks like using the Excel built-in Webscraper:

    HTML Code: 
    to the end, but I'm just showing the first 10 as a demonstration.

  7. #7
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: How to extract web data into a temporary file that would be used as input variables

    Yes, this is what I am looking for by using vba to download the list of stock because I would use them one by one to search other information. Could you show me the code to do this? Thanks
    Quote Originally Posted by abousetta View Post
    This is what it looks like using the Excel built-in Webscraper:

    HTML Code: 
    to the end, but I'm just showing the first 10 as a demonstration.
    Last edited by lubbamkt; 10-12-2014 at 11:37 AM.

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to extract web data into a temporary file that would be used as input variables

    Put this in a standard module:

    Please Login or Register  to view this content.
    You need http://www. at the beginning of the URL.

    abousetta

  9. #9
    Forum Contributor
    Join Date
    11-12-2010
    Location
    HK
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: How to extract web data into a temporary file that would be used as input variables

    Thanks abousetta
    Quote Originally Posted by abousetta View Post
    Put this in a standard module:

    Please Login or Register  to view this content.
    You need http://www. at the beginning of the URL.

    abousetta

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: How to extract web data into a temporary file that would be used as input variables

    You're welcome. Please mark this thread as solved.

    abousetta

  11. #11
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: How to extract web data into a temporary file that would be used as input variables


    Hi lubbamkt !

    You already had two others methods in your previous thread ! …

+ 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 data using two variables or criteria
    By uniqbboy in forum Excel General
    Replies: 2
    Last Post: 09-09-2014, 11:59 AM
  2. Extract user input data from one excel file into another
    By jigneshoctober in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2013, 07:39 PM
  3. Extract data based on variables from multiple subfolders
    By honeybunny in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-28-2013, 09:56 AM
  4. Input data to a table using 2 variables
    By Christophe.Zucchetto in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-29-2011, 07:33 AM
  5. [SOLVED] need to extract data from a pivot table using variables instead o.
    By KyWilde in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2005, 05:06 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