单击网格的页码

时间:2017-08-03 03:45:37

标签: vba excel-vba excel

我需要使用VBA代码点击href" 2" (第二页) 由于没有ID名称,我无法使用

  ie.document.getElementById("ctl00_ContentPlaceHolder1_searchResults_searchResultsGrid_imgExportExcel").Click option

  <div id="ctl00_ContentPlaceHolder1_searchResults_searchResultsGrid_pagingButtonsPanel">
      <span class="gridPagerPageLinkCurrent" 1 ></span>
      <a class="gridPagerPageLink" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$searchResults$searchResultsGridPAGE', 2)" target="_self" 2 ></a>
  </div>

1 个答案:

答案 0 :(得分:0)

尝试:

  ie.document.getElementById( _ 
 "ctl00_ContentPlaceHolder1_searchResults_searchResultsGrid_imgExportExcel") _
 .getElementsByTagName("a")(0).Click