extract data from a source code of a webpage to worksheet

cronaldo

New Member
Joined
Jan 22, 2010
Messages
12
The following script is the source code of a webpage http://www.aastocks.com/en/ltp/rtquote.aspx?symbol=00005

I would like to extract part of the information embedded in the script to my excel worksheets.
e.g.
1. Last 80.7
2. Market Cap 1,405.94B

I am very weak at html code and just beginner of VBA coding. Can anyone give me any idea? thanks a lot.

Code:
  <table width="100%" cellpadding="0" class="m_T">
                        <tr>
                            <td>
                                <table width="100%" cellpadding="0" cellspacing="1">
                                    <tr valign="top">
                                        <td rowspan="2" class="bg1 W1" width="50%">
                                            <ul class="UL1">
                                                <li class="LI1 font13_grey W1" style="padding-bottom: 16px">
                                                    Last
                                                </li>
                                            </ul>
                                            <ul class="UL1">
                                                <li class="LI2 font28 C bold W1" style="font-size: 30px">
                                                    <span class="neg bold">80.700</span>
                                                </li>
                                                <li class="C"><a href="http://www.aastocks.com/en/stock/DetailQuote.aspx?symbol=00005" id="ctl00_ctl00_cphContent_cphContent_lnkDetailQuote" class="font12a">
                                                    Detailed Quote
                                                </a></li>
                                            </ul>
                                            <ul class="UL1 none" style="display: none;">
                                                <li class="LI1 C W1">
                                                    <img src="/en/Images/Stock/icon_see.gif" border="0" alt="" /><a id="ctl00_ctl00_cphContent_cphContent_lnkAddMonitor" class="font13a"></a><img alt=""
                                                            src="/en/Images/Stock/icon_group.gif" border="0" /><a id="ctl00_ctl00_cphContent_cphContent_lnkAddPortfolio" class="font13a"></a>
                                                </li>
                                            </ul>
                                        </td>
                                        <td class="bg2 T1 W1" width="50%">
                                            <ul class="UL1 W1">
                                                <li class="LI1 font13_grey W1">
                                                    Chg
                                                </li>
                                            </ul>
                                            <ul class="UL1 W1">
                                                <li class="LI1_1 font20 C bold W1">
                                                    <img src="../Images/LTP/arrow_r.gif" style="border:0px;" /> <span class="neg bold">[COLOR="Red"]3.150[/COLOR]</span>
                                                </li>
                                            </ul>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="bg2 T1 W1">
                                            <ul class="UL1 W1">
                                                <li class="LI1 font13_grey W1">
                                                    Chg(%)
                                                </li>
                                            </ul>
                                            <ul class="UL1 W1">
                                                <li class="LI1_1 font20 C bold W1">
                                                    <img src="../Images/LTP/arrow_r.gif" style="border:0px;" /> <span class="neg bold">3.757%</span>
                                                </li>
                                            </ul>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="bg3 T2">
                                            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                <tr class="bg3 T2">
                                                    <td class="font13_grey">
                                                        Volume
                                                    </td>
                                                    <td class="font13 R">
                                                        47.88M
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td class="bg3 T2">
                                            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                                <tr class="bg3 T2">
                                                    <td class="font13_grey">
                                                        Market Cap
                                                    </td>
                                                    <td class="font13 R">
                                                        1,405.94B
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top