1. leapfrogdevelopment
  2. PunkyBrowster

Source

PunkyBrowster / punky / browster.py

Diff from to

File punky/browster.py

  • Ignore whitespace
         if (el.tagName() == 'TEXTAREA' or
            (el.tagName() == 'INPUT' and
             str(el.attribute('type')) in SUPPORTED_STRING_INPUT_TYPES)):
-            v = self._first(selector).evaluateJavaScript('this.value')
+            v = el.evaluateJavaScript('this.value')
             return unicode(v.toString())
         else:
             raise PunkyError('value() expected input[type=text] or textarea')
         if el.tagName() == 'INPUT':
             input_type = str(el.attribute('type'))
             if input_type in ('radio', 'checkbox'):
-                v = self._first(selector).evaluateJavaScript('this.checked')
+                v = el.evaluateJavaScript('this.checked')
                 return v.toBool()
 
         raise PunkyError('checked() expected input[type=radio] or input[type=checkbox]')
         """
         el = self._get_element(selector_or_element)
         if el.tagName() == 'OPTION':
-            v = self._first(selector).evaluateJavaScript('this.selected')
+            v = el.evaluateJavaScript('this.selected')
             return v.toBool()
 
         raise PunkyError('selected() expected option')