Can Not Click "Select Photos From My Computer" Button In Google My Business Using Selenium
Question: When trying to click on the Google My Business "Select Photos From My
Computer" button I receive this error. I have tried using ever Identifying
element type that selenium offers in the Documentation but cant seem to get
this button to click.

    
    
    Traceback (most recent call last):
     File "C:/Users/Office/Documents/Development/Web_Postmate.py", line 18, in <module>
    elem6 = driver.find_element_by_partial_link_text("Select photos from your computer")
    File "C:\Users\Office\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 338, in find_element_by_partial_link_text
    return self.find_element(by=By.PARTIAL_LINK_TEXT, value=link_text)
    File "C:\Users\Office\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 744, in find_element
    {'using': by, 'value': value})['value']
    File "C:\Users\Office\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 233, in execute
    self.error_handler.check_response(response)
    File "C:\Users\Office\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"partial link text","selector":"Select a photo from your computer"}
    Stacktrace:
    at FirefoxDriver.prototype.findElementInternal_ (file:///C:/Users/Office/AppData/Local/Temp/tmpuv4pvvys/extensions/fxdriver@googlecode.com/components/driver-component.js:10770)
    at fxdriver.Timer.prototype.setTimeout/<.notify (file:///C:/Users/Office/AppData/Local/Temp/tmpuv4pvvys/extensions/fxdriver@googlecode.com/components/driver-component.js:625)
    

Here is the Button HTML I have to use "Class" and "Link Text"

    
    
    <div tabindex="0" class="c-F-U e-d e-d-Ac" role="button" style="-moz-user-select: none;">Select photos from your computer</div>
    

Here is my source file:

    
    
    from selenium import webdriver
    from selenium.webdriver.common.keys import Keys
    
    driver = webdriver.Firefox()
    driver.get("https://business.google.com/b/101831927968068062215/photos/l/03416071574991367502")
    
    elem = driver.find_element_by_name("Email")
    elem.send_keys("User")
    elem.send_keys(Keys.ENTER)
    driver.implicitly_wait(5)
    elem1 = driver.find_element_by_name("Passwd")
    elem1.send_keys("Password")
    elem1.send_keys(Keys.ENTER)
    driver.implicitly_wait(5)
    elem5 = driver.find_element_by_class_name("tx")
    elem5.click()
    driver.implicitly_wait(5)
    elem6 = driver.find_element_by_partial_link_text("Select photos from  your computer")
    elem6.click()
    


Answer: You have specified `'...a photo...'` in your locator while in `HTML` source
text contains `'...photos...'`

To use both `class` and link text try:

    
    
    driver.find_element_by_xpath('//div[@class="c-F-U e-d e-d-Ac"][contains(text(), "Select photos from your computer")]')
    

