0
我想從網站上拉出一些數據並將其放入excel。在&之前,我已經完成了這項工作,編寫的代碼將我登錄並瀏覽到我想要的頁面。Excel VBA網頁抓取 - 針對不同的框架
在這一點上,但網站是在不同的格式。我想要的頁面有框架。頂部框架有一個橫幅和一些文本,然後在底部框架中有一個表單。當我在我的VBA代碼中瀏覽到這一點時,它似乎只能找到頂部框架 - 沒有形式等。我如何專門針對框架的形式?
HTML源代碼:
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="../custom/LeftSideSquareTabs.css">
<script type="text/javascript" language="javascript" src="../include/JSCommon.js"></script>
<Script language="JavaScript">
function Dummmy()
{
parent.location.replace('../login.asp?Locale=EN&Lo=1')
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="10">
<table border="0" cellpadding="0" cellspacing="0" width="786">
<tr>
<td width="50%" align="left" height="62"></td>
<td width="50%" align="right" height="62">
<a href="http://www.website.com" target="_blank">
<img name="ToolbarRightLogo" src="../custom/ToolbarlogoRight.gif" border="0" alt="MMIA version 5.1.0">
</a>
</td>
</tr>
</table>
<table width="786" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="TabsOff" onclick="dispayMen();">Option A</td>
<td class="TabsImage"><img src="../images/TabOff.gif" width="4" height="17"></td>
<td><img src="../images/spacer.gif" width="1" height="1"></td>
<td class="TabsOn">Option B<</td>
<td class="TabsImage"><img src="../images/TabOn.gif" width="4" height="17"></td>
<td><img src="../images/spacer.gif" width="1" height="1"></td>
<td><img src="../images/spacer.gif" width="466" height="1" WIDTH="1" HEIGHT="1"></td>
<td class="SupportOff" onMouseOver="this.className='SupportOver'" onMouseOut="this.className='SupportOff'" onclick="LogOutSession()">Log out</td>
<a href="mailto:[email protected]"><td class="Support" onMouseOver="this.className='SupportO'" onMouseOut="this.className='Support'">Contact</td></a>
<td><img src="../images/spacer.gif" width="10" height="1"></td>
</tr>
<tr>
<td class="TabsOffBottom" colspan="2"><img src="../images/spacer.gif" width="1" height="1"></td>
<td class="TabsOnBottom" colspan="3"><img src="../images/spacer.gif" width="1" height="1"></td>
<td class="TabsOffBottom" colspan="7"><img src="../images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
<table class="TabsOnBottom" width="786" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="TabsOffBottom"><img src="../images/spacer.gif" width="1" height="1"></td>
<td><img src="../images/spacer.gif" width="9" height="8"></td>
<td class="MiddleToolbarText" width="526">Option B</td>
<td class="MiddleToolbarRightText" width="185">Updated to: </td>
<td class="MiddleToolbarText" width="55">11-02-2015</td>
<td><img src="../images/spacer.gif" width="9" height="1"></td>
<td class="TabsOffBottom"><img src="../images/spacer.gif" width="1" height="1"></td>
</tr>
</table>
<table class="TabsOnBottom" width="786" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="TabsOffBottom"><img src="../images/spacer.gif" width="1" height="1"></td>
</tr>
</table>'
如果沒有HTML源代碼幾乎不可能回答這個問題,請添加它。 – 2015-02-11 11:42:12
我已經添加了正在被抓取的頁面的源代碼。此代碼不包含我想要廢棄的數據。 「選項B」似乎是我需要的選項....我可以在屏幕上看到數據,但不在該源代碼中。請問你可以進一步解釋一下嗎? – 2015-02-12 12:09:39