Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

unable to load iframe with descend_frame() #125

Open
monocasual opened this Issue · 0 comments

1 participant

@monocasual

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

ghost.descend_frame(frame.frameName())
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:

# ...

ghost.descend_frame(frame.frameName())
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
Something went wrong with that request. Please try again.