1

I am simulating click of a button using Ghost.py.But unable to figure out how to get the content which is loaded after clicking the button.

from ghost import Ghost

ghost = Ghost(wait_timeout=40)
page, extra_resources = ghost.open("http://www.samsung.com/in/consumer/mobile-phone/mobile-phone/viewall")
#ghost.wait_page_loaded()
n=2;

print type(ghost.click("input#txtViewAll"))

What to do next to get the dynamically loaded content?

PS:looked in google.Could not get answer

Thanks in advance

1 Answer 1

2

I think this should be the answer:

page, resources = ghost.evaluate(
    "document.getElementById('txtViewAll').click();", expect_loading=True)

Regards,

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.