This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Find Bacterial Ig-like domain (group 3) in proteins through NCBI Conserved Domains Batch CD-Search

I am using Selenium in Python to access Batch CD-Search:

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

# make sure to download the chromedriver.exe and put in a known location
browser = webdriver.Chrome()

browser.get('https://www.ncbi.nlm.nih.gov/Structure/bwrpsb/bwrpsb.cgi')

proteins = ["ADC47899.1", "HBB"]
# this textarea correspond to the box where you past the desired sequence
textarea = browser.find_elements_by_tag_name('textarea')[0]


# this command send the sequence you want to search
textarea.send_keys(proteins)
# the button variable searchs for the submit button
button = browser.find_element_by_id('Launch a new search')
button.submit()

But it is giving me error although the new browser windows with ids open:

NoSuchElementException                    Traceback (most recent call last)
<ipython-input-5-0754fba0e39d> in <module>
     15 textarea.send_keys(proteins)
     16 # the button variable searchs for the submit button
---> 17 button = browser.find_element_by_id('Launch a new search')
     18 button.submit()

But they are not automatically clicking on submit button after getting ids. Also, I need my program to show only the Bacterial Ig-like domain (group 3) by taking input proteins.

Can anyone help me to modify my code?

ncbi python

0 answers

No answers yet.

Log in to answer this question.