Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Ghost.open always returns None as the page #124

Open
Elusive138 opened this Issue · 2 comments

3 participants

@Elusive138

Running the latest from pip, with PyQt4.10.

Using the example code, page is always None:

from ghost import Ghost
ghost = Ghost()
page, extra_resources = ghost.open("http://jeanphi.fr")
assert page.http_status==200 and 'jeanphix' in ghost.content

This is reproducible with any site, including the default Apache page (plain, basic HTML with no redirects, etc.).

I think I've narrowed it down to wait_for_page_loaded in Ghost.py:864:

        if url == resource.url or url_without_hash == resource.url:

That's comparing a string (url = self.main_frame.url().toString() [Ghost.py:860]) to a PyQt4.QtCore.QUrl (resource.url), which will never be true.

It looks like this commit is related.

I'm not entirely sure if this is a bug in the script, or my setup is somehow incorrect.


P.S. The example should probably be updated - http://jeanphi.fr now leads to a 301 redirect, which also breaks the example.

@douglaz

Same here.

@ciokan

+1

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.