0

I try to click a button whenever the button shows. However when the button shows, in google chrome's page source, the actual URL is not shown. Here's the source:

 <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>

# is a link of the current page(it is a hyperlink), when it should be the URL of next page. However when I "inspect" the button after it appears:

<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>

Any idea how to click the button? Thanks!

Gregor Isack
  • 1,111
  • 12
  • 25

2 Answers2

0

The link must be a side effect of JS. You can't see the changes made by JS in source code. JS is client-side. It executes on the browser. However, you can see in inspect element.

And source code doesnt show the side-effects of executed JS. It show the page got from the server.

Daniel Beck
  • 20,653
  • 5
  • 38
  • 53
0

You can use waitForKeyElements with jQuery's :visible selector to click the button only once it is displayed.

Something like:

waitForKeyElements (
    "#button:visible", 
    clickButtton
);

function clickButton(jNode) {
jNode.click();
}
Chava Geldzahler
  • 3,605
  • 1
  • 18
  • 32