makinacorpus/spynner — Issue #3: Errors while using spynner
Author: vandanab
Created: 2012-02-27 16:59:16+00:00
State: open

Hi,
I am trying to use spynner for one of my projects.
I have tried using both the latest stable version (1.10) and the code from trunk, (version 1.11), but its giving me the same error.

code:
browser = spynner.Browser()
browser.load(self.url)
self.html = browser.html
print self.html
browser.close()

I am getting the following error:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/spynner-1.11dev-py2.7.egg/spynner/browser.py", line 232, in _manager_create_request
reply = QNetworkAccessManager.createRequest(self.manager,
AttributeError: 'Browser' object has no attribute 'manager'

This error arises when the browser.close() function is called (as part of the destructor or when it is called explicitly):
if self.manager:
del self.manager
if self.webpage:
del self.webpage

(if self.webpage gives the error)

I tried a couple of things such as commenting these lines (I saw a version of code - (svn/trunk version, surprisingly different from github - http://code.google.com/p/spynner/source/browse/trunk/spynner/browser.py) where these lines were not present in the close function) but other errors start surfacing.
(Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/spynner-1.11dev-py2.7.egg/spynner/browser.py", line 222, in _manager_create_request
operation_name = self._operation_names[operation].upper()
AttributeError: 'Browser' object has no attribute '_operation_names')

I noticed an issue with the trunk packaging too. The jquery files dont get copied to the package (dist-packages/spynner-1.11dev-py2.7.egg/spynner/javascript/) when I install from the source code. I manually copied them over.

Please let me know if I am doing something wrong or there is some kind of bug there.
If you need more information on the error, let me know.