2

Here is my code:

from ghost import Ghost

import time,sys,os

url="http://www.endclothing.com/au/valentino-rockrunner-sneaker-ky0s0723-dnc-0ac.html"

gh=Ghost()

session=gh.start()

try:

page_resource=session.open(url,timeout=999)

except Exception as e:

    print "Major error has occurred, cant load webpage!"

    print e

    raw_input("PRESS ENTER TO EXIT!")

    sys.exit()

session.wait_for_page_loaded()

session.capture_to("preview.jpg")

try:

    os.startfile("preview.jpg")

except Exception:

    print "Cant look at preview"

Now , whenever I look at the preview, the page hasnt been properly loaded. Ive searched all over trying to find out what the problem is but i cant find a solution. It works perfectly when I try it on www.google.com though.

Tom
  • 71
  • 1
  • 2
  • 11

1 Answers1

0

The ghost module doesn't load javascript. Another useful module that is similar to this one is Selenium.

Tom
  • 71
  • 1
  • 2
  • 11