unable to load iframe with descend_frame() #125

monocasual opened this Issue Oct 11, 2013 · 0 comments


None yet
1 participant

Hi guys,

I'm trying to log into my google+ account and do some operations. The dashboard is made of two main iframes, one of which contains the elements I need to scrape. This is my code so far:

#  ... 
# [login ok, dashboard loaded]
#  ... 

# count frames in dashboard: I need frames[1]

frames = ghost.main_frame.childFrames()
print '{} frames found: {}'.format(len(frames), [str(frame.frameName()) for frame in frames])
frame = frames[1]

# change iframe

print 'descended to {}'.format(frame.frameName())

ghost.wait_for_page_loaded() # timeout!

Unfortunately wait_for_page_loaded() throws a TimeoutError. I also found that the iframe contains no useful HTML, just Javascript source code:

# ...

print 'descended to {}'.format(frame.frameName())

def cond():
    return str(ghost.main_frame.toHtml()) != '<html><head></head><body></body></html>'
ghost.wait_for(cond, 'timeout!')

print ghost.main_frame.toHtml()

Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment