Open GoogleCodeExporter opened 9 years ago
How do you do the select? I made a quick test using pyquery and it worked fine:
d = pyquery.PyQuery(html)
print d('#ctl00_plSearch_dblBolge_dblBolge_DropDownList1')
...
print d('#ctl00_plSearch_dblBolge_dblBolge_DropDownList2')
(note that development of this package has moved to github)
Original comment by tokland
on 14 Jul 2011 at 8:58
Actually, I have just found out that problem was something different, I was
trying to select from a wrong <select>, and solved it now. However, there is
still something I don't understand.
I do the selects as follows (br is a spynner.Browser object here):
br.select("id=ctl00_plSearch_dblBolge_dblBolge_DropDownList1, option[value=70]")
br.select("id=ctl00_plSearch_dblBolge_dblBolge_DropDownList2, option[value=70]")
The second select has no option with a value 70 on the site, however, when I
run the second select, it selects the option with value 70 from the first
select, even though I provided the second select's id. What could be the reason
for this?
Original comment by akcali.ozgur
on 14 Jul 2011 at 10:06
try directly in chrome, Browser#select is nothing more than a Jquery call:
def select(self, selector):
"""Choose a option in a select using a jQuery selector."""
jscode = "%s('%s').attr('selected', 'selected')" % (self.jslib, selector)
self._runjs_on_jquery("select", jscode)
what happens if you run this in the JS console
Original comment by tokland
on 14 Jul 2011 at 10:55
Original issue reported on code.google.com by
akcali.ozgur
on 14 Jul 2011 at 6:46