def getMCFunc(driver, method_string):
    """ 根据字符串返回对应的selenium定位函数 """
    method_dict = {'id': driver.find_element_by_id, 'name': driver.
        find_element_by_name, 'tag_name': driver.find_element_by_tag_name,
        'css_selector': driver.find_element_by_css_selector, 'link_text':
        driver.find_element_by_link_text, 'partial_link_text': driver.
        find_element_by_partial_link_text, 'xpath': driver.
        find_element_by_xpath, 'class_name': driver.find_element_by_class_name}
    methods_dict = {'id': driver.find_elements_by_id, 'name': driver.
        find_elements_by_name, 'tag_name': driver.find_elements_by_tag_name,
        'css_selector': driver.find_elements_by_css_selector, 'link_text':
        driver.find_elements_by_link_text, 'partial_link_text': driver.
        find_elements_by_partial_link_text, 'xpath': driver.
        find_elements_by_xpath, 'class_name': driver.
        find_elements_by_class_name}
    for method in methods_dict:
        if (method_string[-1] == 's' and method_string != 'cs' and 
            method_string != 'css' and method_string != 'ss'):
            if method_string[:-1] in method:
                return methods_dict[method]
        elif method_string in method:
            return method_dict[method]
