0

I have a web page https://wpt1.ide4.bid/

The source code and Inspected code via chrome are different.

Is there any way to get inspected code via js after page load or 5 seconds and store it?

How would i achieve this?

currently i am not able to get the javascript working because it saves source code.

document.getElementById("main-region").textContent.indexOf('Thank You For scheduling 22')

Any help will be aprreciated!

4
  • JavaScript running where? Store it where? Commented Jun 13, 2018 at 6:56
  • @Quentin Store it in a variable and i am running in web browser currently, later i will implement it in header via script if it works, i have updated my question. Please check Commented Jun 13, 2018 at 6:58
  • Are you looking to get the html render in iframe from calendly? Because that is the only part which is dynamically loading after page load. Commented Jun 13, 2018 at 8:51
  • @PraveenPoonia Yes Exactly Please help me Commented Jun 13, 2018 at 9:34

1 Answer 1

1

You can use the below solution to get the html of iframe once page is loaded -

 document.addEventListener("DOMContentLoaded", function(event) {
    // Code to execute when all DOM content is loaded. 
        var iframeInnerHtml = document.querySelector('.calendly-inline-widget > iframe').contentWindow.document.body.innerHTML;
        console.log(iframeInnerHtml);
});
Sign up to request clarification or add additional context in comments.

5 Comments

it returns Undefined, can you please add to check text "Thank You For scheduling 22" inside DIV with ID "main-region". Thanks
Try this - var iframeContainer = document.querySelector('.calendly-inline-widget'); console.log(iframeContainer); var iframe = iframeContainer.querySelector('iframe'); console.log(iframe); var iframeInnerHtml = iframe.contentWindow.window.document.body.innerHTML; console.log(iframeInnerHtml);
Can you please help me to check the content inside it "15 Minutes".
@NimeshDeo - what content you want to check? Share the code or dom object.
Inside iframe there is a div with id "main-region" inside that div I need to look for text "Thanks For scheduling" each 5 seconds. Please help me achieve it. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.