AttributeError: 'Browser' object has no attribute 'manager' when test spynner
Question: I'm trying to use spynner to auto-click some button in the HTML source code as
a small test. But I'm receiving this error. Traceback (most recent call last):
File "build\bdist.win32\egg\spynner\browser.py", line 287, in _on_reply
AttributeError: 'Browser' object has no attribute 'manager'

Below is my code, which is following the guide
here:<https://github.com/makinacorpus/spynner/blob/master/examples/webkit_methods.py>

    
    
    import spynner
    import libxml2
    
    proxy_ip = "xxx.xxx.xxx.xxx";
    browser = spynner.Browser()  
    
        # setting proxy ip  
    browser.set_proxy(proxy_ip :'8080'); 
    browser.show() 
    
    try:  
            browser.load(url='http://xxx.html', load_timeout=10, tries=1)  
    except spynner.SpynnerTimeout:  
            print 'Timeout.'  
    else:  
    
            browser.wk_click('a[id="voteProjectBtn_10353150"]', wait_load=True)  
    browser.close()  
    

I'm using Python 2.7, thanks for the help!


Answer: before `browser.close()`, you must distroy the loop javascript, some website
has timming script, so you need distroy these script see the browser.py,
change the method "_manager_create_request" , before `browser.close()`, set
`self.closeflag = True`

    
    
    def _manager_create_request(self, operation, request, data):
        if self.closeflag:
            return None
        url = unicode(request.url().toString())
        operation_name = self._operation_names[operation].upper()
        self._debug(INFO, "Request: %s %s" % (operation_name, url))
        for h in request.rawHeaderList():
            self._debug(DEBUG, "  %s: %s" % (h, request.rawHeader(h)))
        if self._url_filter:
            if self._url_filter(self._operation_names[operation], url) is False:
                self._debug(INFO, "URL filtered: %s" % url)
                request.setUrl(QUrl("about:blank"))
            else:
                self._debug(DEBUG, "URL not filtered: %s" % url)
        reply = QNetworkAccessManager.createRequest(self.manager,
            operation, request, data)
        return reply
    

