def convert_to_css_selector(self, selector, by):
if by == By.CSS_SELECTOR:<EOL><INDENT>return selector<EOL><DEDENT>elif by == By.ID:<EOL><INDENT>return '<STR_LIT>' % selector<EOL><DEDENT>elif by == By.CLASS_NAME:<EOL><INDENT>return '<STR_LIT>' % selector<EOL><DEDENT>elif by == By.NAME:<EOL><INDENT>return '<STR_LIT>' % selector<EOL><DEDENT>elif by == By.TAG_NAME:<EOL><INDENT>return selector<EOL><DEDENT>elif by == By.XPATH:<EOL><INDENT>return self.convert_xpath_to_css(selector)<EOL><DEDENT>elif by == By.LINK_TEXT:<EOL><INDENT>return '<STR_LIT>' % selector<EOL><DEDENT>elif by == By.PARTIAL_LINK_TEXT:<EOL><INDENT>return '<STR_LIT>' % selector<EOL><DEDENT>else:<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>" % (<EOL>selector, by))<EOL><DEDENT>
This method converts a selector to a CSS_SELECTOR.
            jQuery commands require a CSS_SELECTOR for finding elements.
            This method should only be used for jQuery/JavaScript actions.
            Pure JavaScript doesn't support using a:contains("LINK_TEXT").