Stefan Behnel <stefan...@behnel.de> wrote:

> You are using Selenium RC here. I have no idea if there is a Python
> API to it or what that API looks like. The rest is just trivial code
> that you can map 1:1 to Python:
> 
>      def count_css_matches(css_locator):
>          java_script_code = '''
>              var cssMatches = eval_css("%s", window.document);
>              cssMatches.length;''' % css_locator
>          return int(selenium.getEval(java_script_code))
> 
> Although I'd simplify the JavaScript code somewhat to make it a plain 
> expression.

You also need somewhere:

    from selenium import selenium

and in Python the method that is needed is selenium.get_eval(...)

-- 
Duncan Booth http://kupuguy.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to