sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Brython should wrap the news selectors of html5 (querySelector) #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

for i in doc.querySelectorAll('span'):
    print(i)

What is the expected output? What do you see instead?
It should print the elements
It raises :" ExecutionError: $iter1.__len__ is not a function"

What version of the product are you using? On what operating system?
any browsers any os

Original issue reported on code.google.com by manat...@gmail.com on 31 Jan 2013 at 1:12

GoogleCodeExporter commented 9 years ago
Thanks for the report
It is fixed in the latest version on SVN and on the Brython site, but with a 
more Pythonic approach : there is a new function doc.get() that takes keyword 
arguments and always returns a list :
doc.get(id=x) returns the element with id x (uses getElementById)
doc.get(name=y) returns the elements with name y (uses getElementsByName)
doc.get(selector=z) returns the elements with selector z
If several keyword arguments are provided, the function returns the 
intersection of lists

Original comment by pierre.q...@gmail.com on 2 Feb 2013 at 5:51

GoogleCodeExporter commented 9 years ago
Perfect !
Le 2 f�vr. 2013 18:52, <brython@googlecode.com> a �crit :

Original comment by manat...@gmail.com on 3 Feb 2013 at 9:55