Closed GoogleCodeExporter closed 9 years ago
another example:
Traceback (most recent call last):
File "google.py", line 10, in <module>
browser.choose("input[name=lr=lang_es]")
File "/Library/Python/2.6/site-packages/spynner/browser.py", line 474, in choose
self._runjs_on_jquery("choose", jscode)
File "/Library/Python/2.6/site-packages/spynner/browser.py", line 323, in _runjs_on_jquery
raise SpynnerJavascriptError("error on %s: %s" % (name, code))
spynner.browser.SpynnerJavascriptError: error on choose:
_jQuery('input[name=lr=lang_es]').simulate('click')
Original comment by btorbi...@gmail.com
on 6 Jan 2011 at 3:34
which version are you using? there was a commit regarding JS not long ago.
Original comment by tokland
on 6 Jan 2011 at 10:48
thanks for pushing me in the right direction I downloaded the newest version
from github and it seems to work now.
great projekt by the way!
Original comment by btorbi...@gmail.com
on 6 Jan 2011 at 1:21
ok!
Original comment by tokland
on 6 Jan 2011 at 1:28
[deleted comment]
I also have javascript not working. I am using spynner on an Ubuntu machine. I
have just installed all the components today, they are all up to date. When I
try to run a simple js command like:
br = spynner.Browser()
br.load("http://www.wordreference.com")
br.runjs("console.log('hello')")
I get this:
<PyQt4.QtCore.QVariant object at 0x1c10db8>
And when I try to click a button invoking some javascript calls like:
br.click("input[name=ctl00$plSearch$btnQuickSearch]")
I get this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/spynner-1.10-py2.6.egg/spynner/browser.py", line 566, in click
self._runjs_on_jquery("click", jscode)
File "/usr/local/lib/python2.6/dist-packages/spynner-1.10-py2.6.egg/spynner/browser.py", line 400, in _runjs_on_jquery
raise SpynnerJavascriptError("error on %s: %s" % (name, code))
spynner.browser.SpynnerJavascriptError: error on click:
jq('input[name=ctl00$plSearch$btnQuickSearch]').simulate('click');
The html for the button is:
<input type="button" name="ctl00$plSearch$btnQuickSearch" value="Hızlı Ara"
onclick="SayacSifirla();WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("ctl00$plSearch$btnQuickSearch", "", false, "",
"Oteller.aspx", false, true))" id="ctl00_plSearch_btnQuickSearch"
class="HizliAraButton" />
But I can click a simple button with no javascript involved.
How can I fix this situation?
Original comment by akcali.ozgur
on 13 Jul 2011 at 8:20
Original issue reported on code.google.com by
btorbi...@gmail.com
on 6 Jan 2011 at 3:33