1

I am using Selenium in the following code to automatically generate different gRNA elements(sequence of strings) using different input data. I show one example below with defined input values for the different drop down menus and input boxes. Once I have input all of the data, I attempt to select the search button. I can successfully select the button, but I cannot click to continue to the next page. This is where I get the NoSuchElementException. Is there a simple solution for this particular case? The line that fails is commented below.

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://atum.bio/eCommerce/cas9/input")

#Select Genome
search = driver.find_element_by_id('genomeId')
for option in search.find_elements_by_tag_name('option'):
        if option.text == 'Saccharomyces cerevisiae S288C (R64-1-1)':
                option.click() # select() in earlier versions of webdrive

#Open Target Gene
target = driver.find_element_by_link_text("Target a genomic region")
target.click()

#Select Chromosome
chromosome = driver.find_element_by_id('chromosomeId')
for option in chromosome.find_elements_by_tag_name('option'):
    if option.text == '5':
                option.click() # select() in earlier versions of webdrive

start_base = driver.find_element_by_name("startBase")      
start_base.send_keys("31694")
end_base = driver.find_element_by_name("endBase")
end_base.send_keys("33466")

time.sleep(2)
#Line that fails - click search to generate ranked list of guides 
get_guide = driver.find_element_by_xpath('//*[contains(concat( " ", @class, " " ), concat( " ", "btn-primary", " " ))]')
get_guide.click()

driver.quit() 

0 Answers0