Selenium WebDriver Python, search WebElement
Question: i am using Selenium to scrape some stuff live, but i can't seem to search a
WebElement even tho the docs say i can.

    
    
    while True:
        try:
            member = self.pdriver.find_all("sv:member_profile")[index]
            self.pdriver.info_log("Found a member")
        except IndexError:
            self.pdriver.info_log("No more members")
            break
    
        member.highlight(style = self.pdriver.get_config_value("highlight:style_on_assertion_success"))
    
        profile = {}
        profile["name"] = member.findElement("sv:member_name").get_attribute('innerHTML')
        profile["image"] = member.findElement("sv:member_image").get_attribute('src')
        profile["link"] = member.findElement("sv:member_link").get_attribute('href')
    
        members.append(profile)
        index += 1
    

This returns a single web element:

    
    
    member = self.pdriver.find_all("sv:member_profile")[index]
    

which i need to search, according to the docs, this element would also have
the findElement method, seems not to be the case tho?

> AttributeError: 'WebElement' object has no attribute 'findElement'


Answer: As the error states, [`WebElement`](https://selenium-
python.readthedocs.org/api.html#selenium.webdriver.remote.webelement.WebElement)
object has no attribute `findElement`. Depending on what are `sv:member_name`,
`sv:member_image` and `sv:member_link`, you need to choose which of the
[`find_element_by_*` methods](https://selenium-
python.readthedocs.org/api.html#selenium.webdriver.remote.webelement.WebElement.find_element_by_class_name)
you need to use.

For instance, if `sv:member_name` is a CSS selector:

    
    
    profile["name"] = member.find_element_by_css_selector("sv:member_name").get_attribute('innerHTML')
    

Or, you may also use the [`find_element()`](https://selenium-
python.readthedocs.org/api.html#selenium.webdriver.remote.webelement.WebElement.find_element)
method directly supplying the `By` value:

    
    
    from selenium.webdriver.common.by import By
    
    profile["name"] = member.find_element(By.CSS_SELECTOR, "sv:member_name").get_attribute('innerHTML')
    

