1

The website i want to crawl have multiple pages which are dynamically loaded and i want to simulate click (without opening browsers as selenium does) and so i m using Ghost.py.

Here is the simple program

from ghost import Ghost
import time

ghost = Ghost(wait_timeout=50)
page, extra_resources = ghost.open("http://www.samsung.com/in/consumer/mobile-phone/mobile-phone/viewall")
#ghost.wait_page_loaded()
n=2;
#links=ghost.evaluate("""
#           alist=document.getElementsById('txtViewAll');
#           alist.click;
#            """)
#print type(ghost.click("input#txtViewAll"))
page1, resources = ghost.evaluate("document.getElementById('txtViewAll').click();", expect_loading=True)
time.sleep(20)
print page1

BUT

Output is None.

Could someone please help me regarding whats wrong with the program.

Why it is not working?

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

0 Answers0