Find Bacterial Ig-like domain (group 3) in proteins through NCBI Conserved Domains Batch CD-Search
0
0
Entering edit mode
2.5 years ago
anasjamshed ▴ 120

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 • 490 views
ADD COMMENT

Login before adding your answer.

Traffic: 2561 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6