单击在页面源代码中不可见的按钮(仅在检查中)



每当按钮出现时,我都会尝试单击按钮。但是,当按钮显示时,在谷歌浏览器的页面源代码中,不会显示实际的URL。以下是来源:

 <div id="fname2"  style="display:none" > Description1  <br/> <span> Description2    </span></div> 
    <div id="fname"><h1 class="ThreeDee"> Preparing Your Links....<br/> Please wait...</h1></div>
    <div id="hata" style="display:none" > Failed to Create Links..  <br/> <span>Please Restart your link Translation . </span></div>
    <div id="vip" style="display:none" > None This Link Download your consent  <br/> <span> More Description1.. </span></div>
</div>
<div id="buton" style="display:none">
  <div class="info-link right" >
    <a href="#">Download</a>
  </div>
</div>

#是当前页面的链接(它是一个超链接(,而它应该是下一页的URL。但是,当我在按钮出现后"检查"它时:

<div id="wrapper">
    <div class="main-menu clearfix">

    </div>
<center><a href="http://example.com/" target="_blank" rel="noreferrer" data-ss1496972790="1"> <img src="./images/example.png"></a></center>


      <div class="info-v3 clearfix">
        <div class="info-txt left">
      <div id="fname2" style=""> Created to download Links  <br> <span> Download your Download Push Button  </span></div> 
            <div id="fname" style="display: none;"><h1 class="ThreeDee"> Preparing Your Links....<br> Please wait...</h1></div>
            <div id="hata" style="display:none"> Failed to Create Links..  <br> <span>Please Restart your link Translation . </span></div>
            <div id="vip" style="display:none"> None This Link Download your consent  <br> <span> This file is a private Vip our users.. </span></div>
        </div>
        <div id="buton" style="">
          <div class="info-link right">
            <a href="http://thedownloadlink.com" data-ss1496972790="1">Download</a>
          </div>
        </div>

      </div>

          </div>

知道如何点击按钮吗?谢谢!

链接必须是 JS 的副作用。您无法在源代码中看到 JS 所做的更改。JS是客户端的。它在浏览器上执行。但是,您可以在检查元素中看到。

源代码没有显示执行 JS 的副作用。它显示从服务器获取的页面。

您可以将 waitForKeyElements 与 jQuery 的 :visible 选择器一起使用,仅在显示按钮时单击该按钮。

像这样:

waitForKeyElements (
    "#button:visible", 
    clickButtton
);
function clickButton(jNode) {
jNode.click();
}

最新更新