Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to load iframe with descend_frame() #125

Open
monocasual opened this issue Oct 11, 2013 · 0 comments
Open

unable to load iframe with descend_frame() #125

monocasual opened this issue Oct 11, 2013 · 0 comments

Comments

@monocasual
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants