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

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Vindhya G
  • 1,339
  • 2
  • 21
  • 46

1 Answers1

2

I think this should be the answer:

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

Regards,

pedromarce
  • 5,651
  • 2
  • 27
  • 27