Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么我的VBA程序没有得到所有等于“0”的标记名;路径“;从一个网站?_Html_Excel_Vba_Web Scraping_Web Scripting - Fatal编程技术网

Html 为什么我的VBA程序没有得到所有等于“0”的标记名;路径“;从一个网站?

Html 为什么我的VBA程序没有得到所有等于“0”的标记名;路径“;从一个网站?,html,excel,vba,web-scraping,web-scripting,Html,Excel,Vba,Web Scraping,Web Scripting,我想知道是否有人能帮我解决这个问题。我正在尝试制作一个程序,该程序将在网页上找到某个图标,然后根据元素的标记名单击所有出现的图标。我试图在其上执行此操作的网页中有4个单独出现的我要搜索的标记,但我只得到1个结果。这就是我目前拥有的: Option Explicit Private Sub CommandButton1_Click() Dim HTMLDoc As HTMLDocument Dim MyBrowser As InternetExplorer Dim MyHTML_Element

我想知道是否有人能帮我解决这个问题。我正在尝试制作一个程序,该程序将在网页上找到某个图标,然后根据元素的标记名单击所有出现的图标。我试图在其上执行此操作的网页中有4个单独出现的我要搜索的标记,但我只得到1个结果。这就是我目前拥有的:


Option Explicit
Private Sub CommandButton1_Click()

Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer
Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
Dim this As Variant


'On Error GoTo Err_Clear
    MyURL = "https://im.academy/login"
    Set MyBrowser = New InternetExplorer
    MyBrowser.Silent = True
    MyBrowser.navigate MyURL
    MyBrowser.Visible = True
    Do
    Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
    Set HTMLDoc = MyBrowser.document

    'fills in the username
    HTMLDoc.all.userInput.Value = "michdoming" 'Enter your email id here

    'fills in the password
    HTMLDoc.all.passInput.Value = "Tinkerock1!" 'Enter your password here

    Set this = HTMLDoc.getElementsByTagName("input")



    'goes through the HMTL elements that have a tag name of "input")
    For Each MyHTML_Element In this

        'Finds the login button which is a submit type
        If MyHTML_Element.Type = "submit" Then

            'clicks the login button
            MyHTML_Element.Click

            Exit For

        End If

    Next

    'loops until the webpage is loaded
    Do While MyBrowser.Busy
    Loop


    MyBrowser.navigate "https://im.academy/enrollerTree"

    'loops until the webpage is loaded
    Do While MyBrowser.Busy
    Loop

'delays the program for 10 seconds
Application.Wait (Now + TimeValue("0:00:10"))

    Set HTMLDoc = MyBrowser.document

    Set this = HTMLDoc.getElementsByTagName("path")

    MsgBox (CStr(this.Length))

    For Each MyHTML_Element In this

       ' If MyHTML_Element.className = "row-expand-icon" Then

            MyHTML_Element.Click

       ' End If

      '  Exit For

    Next



'Err_Clear:
 '   If Err <> 0 Then
  '  Err.Clear
   ' Resume Next
    'End If
MsgBox ("Done")
End Sub


选项显式
私有子命令按钮1_单击()
将HTMLDoc设置为HTMLDocument
将MyBrowser设置为InternetExplorer
将MyHTML_元素设置为IHTMlement
将MyURL设置为字符串
将此变暗为变体
'在出错时转到错误\u清除
MyURL=”https://im.academy/login"
设置MyBrowser=New InternetExplorer
MyBrowser.Silent=True
MyBrowser.navigate MyURL
MyBrowser.Visible=True
做
循环,直到MyBrowser.readyState=readyState\u完成
设置HTMLDoc=MyBrowser.document
'填写用户名
HTMLDoc.all.userInput.Value=“michdoming”'在此处输入您的电子邮件id
'填写密码
HTMLDoc.all.passInput.Value=“Tinkerock1!”“在此处输入密码
设置此参数=HTMLDoc.getElementsByTagName(“输入”)
'遍历标记名为“input”的HMTL元素)
对于此文件中的每个MyHTML_元素
'查找属于提交类型的登录按钮
如果MyHTML\u Element.Type=“提交”,则
'单击登录按钮
MyHTML_元素。单击
退出
如果结束
下一个
'循环,直到网页加载
在我的浏览器忙的时候做
环
MyBrowser.navigate“https://im.academy/enrollerTree"
'循环,直到网页加载
在我的浏览器忙的时候做
环
'将程序延迟10秒
Application.Wait(现在+时间值(“0:00:10”))
设置HTMLDoc=MyBrowser.document
设置this=HTMLDoc.getElementsByTagName(“路径”)
MsgBox(CStr(此长度))
对于此文件中的每个MyHTML_元素
'如果MyHTML_Element.className=“行展开图标”,则
MyHTML_元素。单击
"完"
"退出
下一个
“呃,很清楚:
'如果错误为0,则
“呃,明白了
“下一步继续
"完"
MsgBox(“完成”)
端接头
网站代码:


<!DOCTYPE HTML PUBLIC "HTML5">
<html>
<head>
<title>IM Academy :: My Referrals</title>
<!-- server ip 172.24.32.102 -->
<!-- corp -->
<meta name="viewport" content="width=device-width">
<link href="/images/favicon.png" rel="short icon" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<link href="/htdocs/pure-form.css" rel="stylesheet" type="text/css" />
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<link href="/htdocs/backOffice2019.css?27" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/images/backoffice2019/favicon.ico" type="image/x-icon">
<link rel="icon" href="/images/backoffice2019/favicon.ico" type="image/x-icon">
<script type="text/javascript">
<!--
function ow (x,y) {
   var opt = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,' + y;
   window.open(x,'',opt);
}
//-->
</script>

</head>
<body>

<div id="moviePage" class="moviePage">
<div id="movie" class="movie">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
 <td align="right"><a href="javascript:movieClose()"><img src="/images/closeX.png" border="0"></a></td>
</tr>
<tr>
 <td ><center><iframe id="movieFrame" src="" width="640" height="460" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></center>
 </td>
</tr>
</table>
<center><a href="javascript:movieClose()">[ Close ]</a></center>
</div>
</div>
<script type="text/javascript">
<!--

document.getElementById('moviePage').style.display="none";
-->
</script>
<div id="outermost">
 <div id="content">
   <div id="header">
    <div id="headerCenter">
     <div id="headerLogo">
      <div id="headerLogoLogo"><a href="/home"><img src="/images/backoffice2019/footerLogo.png" border="0"></a></div> 
      <div id="headerLogoMenu"><div id="headerLogoMenuLink"><a href="javascript:leftColumn()" ><i class="fas fa-bars"></i></a></div></div>
<svg class="svg-inline--fa fa-bars fa-w-14" aria-hidden="true" data-prefix="fas" data-icon="bars" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"></path></svg>
      </div>
     <div id="headerGoogleSec">
     <div id="google_translate_element"></div>
      <script>
        function googleTranslateElementInit() {
         new google.translate.TranslateElement({
         pageLanguage: 'en',
         layout: google.translate.TranslateElement.InlineLayout.SIMPLE
         }, 'google_translate_element');
        }
      </script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
     </div><! -- header Google sec -->
      <div id="headerRight">
       <div id="headerRightNav">
        <div id="headerProfilePic"><a href="/avatar"><img src="/images/genericPerson.jpg" border="0"></a></div>
        <div id="headerID">ID #1985996</div>
        <div id="headerSettings"><a href="https://im.academy/profile"><img src="/images/headerSettingsIcon.png"></a></div>
        <div id="headerLogout"><a href="/logout"><img src="/images/headerLogoutIcon.png"></a></div>
       </div><!-- header right Nac -->
      </div>
    </div><!-- header center -->
   </div><!-- header -->
  <div id="bodyRow">
   <div id="bodyCell">
    <div id="mainBody">
     <div id="leftCol">
<br>
      <div class="profile_picture"><a href="/avatar"><img src="/images/genericPerson.jpg" border="0"></a></div>
      <div class="profile_name">Michael Dominguez</div>
      <div class="profile_id">1985996</div>

<br>
       <div class="leftColHeader">Menu</div>
         <ul>
          <li><a href="/home"><span>Home</span></a></li>
          <li><a href="https://www.im.center/" target="_blank"><span>im.center</span></a></li>
          <li><a href="https://apps.apple.com/us/app/im-academy/id1475073258" target="_blank"><span>IM academy app Apple</span></a></li>
          <li><a href="https://play.google.com/store/apps/details?id=com.growthengineering.imarket&hl=en_US" target="_blank"><span>IM academy app Android</span></a></li>

          <li><a href="/legacyLinks"><span>Old Links</span></a></li>
          <li><a href="/myURL"><span>My Referral Links</span></a></li>
          <li><a href="/enrollerTree"><span>My Referrals</span></a></li>
          <li><a href="https://im.academy/upgrade"><span>Shopping Cart</span></a></li>
          <li><a href="/recentOrders"><span>Order History</span></a></li>
          <li><a href="/enrollers"><span>Upline IBOs</span></a></li>
          <li><a href="/BOSpamPolicy"><span>Spam Policy</span></a></li>
          <li><a href="https://im.academy/profile"><span>Personal Info</span></a></li>
          <li><a href="/contactUs"><span>Contact Us</span></a></li>
          <li><a href="/logout"><span>Logout</span></a></li>
         </ul>


     </div>


     <div id="liBody">
            <div id="liBodyContent" style=" height:calc(100% - 134px); ">


<div id="breadCrumbs">
 <a href="/index">Home</a>&nbsp;&nbsp;<span class="bcArrow">&#187;</span>&nbsp;&nbsp;
 <div class="breadCrumbName"> My Referrals</div>
</div>
             <div class="pageTitle">My Referrals</div>
               <br>
            <div class="liBodyContent">


<center><a href="enrollerTreeGraphic"><button type="button" style="font-size:11px">Graphic View</button></a></center>
<!--2020-05-07 -->
<script language="javascript">
<!--
function goButton() {
   document.forms['ETREE'].elements['ID'].value = document.forms['ETREE'].elements['UPLINE'].value;
   document.forms['ETREE'].submit();
}
function go(x) {
   document.forms['ETREE'].elements['ID'].value = x;
   document.forms['ETREE'].submit();
}
-->
</script>

<p>
<table width="100%">
<tr>
<td width="50%" valign="top">

<table class="styledTable  textL">
<tr >
<td colspan="2"><b>Your Stats  (michdoming)</b></td>
</tr>
<tr >
<td>Personally Enrolled IBOs</td>
<td align="right"></td>
</tr>
<tr >
<td>Personally Enrolled Customers</td>
<td align="right">1</td>
</tr>
</table>

</td>
</tr>
</table>
</p>

<p><b>Important:</b> If you have over 5,000 Members in your unilevel tree, it may take longer to open all levels.  To find a specific person in your organization faster, we suggest using the <a href="findUser?SEARCH=2&VALUE=1985996"><u>Find User</u></a> page.</p>


<style>
.styledTable td {
   font-size:12px;
   line-height:1.7em;
}
body {
   padding: 20px;
   box-sizing: border-box;
}
.styledTable{
   overflow: hidden;
   width: 100%;
}
.cellWithComment{
   position:relative;
}
.cellComment{
   display:none;
   position:absolute;
   z-index:100;
   border:1px;
   width:300px;
   background-color:white;
   border-style:solid;
   border-width:1px;
   border-color:#5bb62e;
   padding:10px;
   top:0px;
   left:0px;
   border-radius:4px;
   color:black;
}

.cellWithComment:hover span.cellComment{
   display:block;
}

</style>

<p></p>

 <script type="application/javascript"> var openIframes = []; function getTopLevelWindow() { var myparent = window.parent; while (myparent !== myparent.parent) myparent = myparent.parent; return myparent; } function putOrDeleteIframe(iframeId, frameWindow) { var alreadyInIndex = -1; for (var i = 0; i < openIframes.length; i++) { if (openIframes[i][0] === iframeId) { alreadyInIndex = i; } } if (alreadyInIndex > -1) { openIframes.splice(alreadyInIndex, 1); } else { openIframes.push([iframeId, frameWindow]); } } var topLevelWindow = getTopLevelWindow(); var isTopLevel = topLevelWindow === window; function iframeScript_iFrameTable () { var iframeId = "iFrameTable"; if (isTopLevel) { window.addEventListener("message", function(e) { if (e.data.iframeId) { putOrDeleteIframe(e.data.iframeId, e.source); } }); if (iframeId !== "") { putOrDeleteIframe(iframeId, window); }  var poller = setInterval(function() { console.log(openIframes.length + " frames open"); for (var i = 0; i < openIframes.length; i++) { var iframeId = openIframes[i][0]; var mywindow = openIframes[i][1]; var iFrameEl = mywindow.document.getElementById(iframeId); if (iFrameEl && iFrameEl.contentWindow) { var iFrameWindow = iFrameEl.contentWindow; var iFrameDoc = iFrameWindow.document; var table = iFrameDoc.getElementsByTagName("table")[0]; if (table) { var tableStyle = iFrameWindow.getComputedStyle(table); var marginTop = parseInt(tableStyle["margin-top"].split("px")[0]); var marginBottom = parseInt(tableStyle["margin-bottom"].split("px")[0]); var paddingTop = parseInt(tableStyle["padding-top"].split("px")[0]); var paddingBottom = parseInt(tableStyle["padding-bottom"].split("px")[0]); var height = parseInt(tableStyle["height"].split("px")[0]); var newHeight = height + marginBottom + marginTop + paddingBottom + paddingTop; iFrameEl.height = newHeight; var end = iFrameDoc.getElementById("end_data"); if (end) { clearInterval(poller); } } } } }, 150); } else { topLevelWindow.postMessage({iframeId: iframeId}, topLevelWindow.location.origin); } } if (isTopLevel) { iframeScript_iFrameTable(); } </script>

<td class="row-expand-icon"><svg class="svg-inline--fa fa-plus-circle fa-w-16 green" aria-hidden="true" data-prefix="fa" data-icon="plus-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"></path></svg><!-- <i class="fa fa-plus-circle green" aria-hidden="true"></i> --></td>
 <style> #iFrameTable { width: 100%; border: none; } </style> <iframe id="iFrameTable" src="?ID=1985996&PDATE=2020-05-07&IFRAME_TABLE=1&MONTH=C&MONTH_TEXT=April&TREE_BV=0&TREE_USERS=0&UP_ONE=0&LEVEL=1&RANK=0" ></iframe>
<div class="alertBox">
<div class="alertBoxPadding">
<ul>
<li>IBO Kit: This column will show if that individual's IBO kit has been paid in the last 30 days</li>
<li>PV: This column will show that individual's personal subscription volume and any a la carte add on's in the last 30 days</li>
<li>PSV: This column will show that individual's OVERALL Personal Enrolled Sales Volume in the last 30 days</li>
<li>PRSV: This column will show that individual's OVERALL Personally Enrolled Customer ONLY Volume in the last 30 days</li>
<li>Total GV: This column will show the SUM of that individual's total sales volume in the last 30 days</li>
<li>Total Customer GV: This column will show the SUM of that individual's total customer sales volume in the last 30 days</li>
<li>55/45 GV: This column will show that individual's qualified sales volume over the last 30 days... after the 55% customer ratio rule has been applied</li>
</ul>
</div>
</div>
             </div>
            </div><!-- li body content -->
    <div id="footer">
     <div id="footerContent">
<br>
   <div class="footer-left">
      <div class="footer-logo">
         <a href="/"><img src="/images/backoffice2019/footerLogo.png" alt=iMarketsLive"></a>
      </div>
   </div>
   <div class="footer-main-container">
     <a href="/home"><img src="/images/backoffice2019/masteryAcademyLogo.png"></a><br>
<a href="/privacyPolicy">Privacy Policy</a> | <a href="/policies">Policies and Procedures</a> | <a href="/termsAndConditions">Terms & Conditions</a> | <a href="/refundPolicy">Refund Policy</a> | <a href="/spamPolicy">Spam Policy</a> | <a href="/nfaNotice">NFA Notice</a>
<br>
Copyright &copy; 2020 iMarketsLive.
     </div>
     <div class="footer-right"></div>
     <div style="clear: both;"></div>
   </div>
    <div id="footerDisclaimer">
FULL RISK DISCLOSURE: Trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing financial security or life style. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is no guarantee of future results.
    </div>
     </div><!-- li body -->
     <div style="clear:both"></div>
    </div><!-- main center-->
   </div><!-- body cell -->
  </div><!-- body row -->
 </div><!-- centerContent -->

</body>

<script type="text/javascript">
<!--
var docHeight = jQuery(document).height();
var windowHeight = jQuery(window).height();
function movie(x,y) {
   document.getElementById('moviePage').style.height=docHeight + "px";
   document.getElementById('moviePage').style.display="";
   var link = "www.youtube.com/embed/_3k7WqwVLT0";
   if (x) {
      link = x;
   }
   if (y == 2) {
      document.getElementById('movieFrame').src = "https:" + link;
   } else {
      document.getElementById('movieFrame').src = "https://" + link + "?autoplay=1&rel=0";
   }
   MakeCenter('movie');
}

function leftColumn() {
  jQuery('#leftCol').slideToggle(400)
}



function movieClose() {

   document.getElementById('moviePage').style.display="none";
   document.getElementById('movieFrame').src ='';
}

function MakeCenter(elementId)  {

     var scrollHeight = jQuery(document).scrollTop();

     var objControl=document.getElementById(elementId);


     if(objControl !=null)  {

          var left=(objControl.offsetParent.clientWidth/2)-(objControl.clientWidth/2)+objControl.offsetParent.scrollLeft;

          var top=(windowHeight/2)-(objControl.clientHeight/2)+scrollHeight;

              document.getElementById('moviePage').style.top=scrollHeight + "px"; 
              top=(objControl.clientHeight/2);

           objControl.style.top= top + "px";
           objControl.style.left= left + "px";
           var _scrollHeight = jQuery(document).scrollTop();
          }
    }

</html>


IM学院::我的推荐
函数googleTranslateElementInit(){
新的google.translate.TranslateElement({
页面语言:'en',
布局:google.translate.TranslateElement.InlineLayout.SIMPLE
}“谷歌翻译元素”);
}
ID#1985996

迈克尔·多明格斯 1985996
菜单
» 我的推荐 我的推荐
你的统计数据(密歇根州) 个人注册的IBO 个人注册客户 1.

重要提示:如果您的unilevel树中有5000多个成员,则打开所有级别可能需要更长的时间。为了更快地找到组织中的特定人员,我们建议使用该页面

.styledTable td{ 字体大小:12px; 线高:1.7em; } 身体{ 填充:20px; 框大小:边框框; } .styledTable{ 溢出:隐藏; 宽度:100%; } Cellwith评论{ 位置:相对位置; } cellComment先生{ 显示:无; 位置:绝对位置; z指数:100; 边界:1px; 宽度:300px; 背景色:白色; 边框样式:实心; 边框宽度:1px; 边框颜色:#5bb62e; 填充:10px; 顶部:0px; 左:0px; 边界半径:4px; 颜色:黑色; } .cellWithComment:悬停span.cellComment{ 显示:块; }

var openIframes=[];函数getTopLevelWindow(){var myparent=window.parent;while(myparent!==myparent.parent)myparent=myparent.parent;return myparent;}函数putordeletieframe(iframeId,frameWindow){var alreadyindex=-1;for(var i=0;i-1){openIframes.splice(alreadyInIndex,1);}else{openIframes.push([iframeId,frameWindow]);}var-topLevelWindow=getTopLevelWindow();var-isTopLevel=topLevelWindow==window;函数iframeScript_-iFrameTable(){-var-iframeId=“iFrameTable”;if(isTopLevel){){.addEventListener(“消息”,函数(e){)if(e.data.iframeId){putOrDeleteIframe(e.data.iframeId,e.source);}};if(iframeId!==“”){putOrDeleteIframe(iframeId,window);}var poller=setInterval(function(){console.log(openIframes.length+“frames open”);for(var i=0;i