I am creating a selenium bot for automatical blasting. I would like to download all my .fasta files into BLAST system and get the result.
This is my code:
from selenium import webdriver def main(): driver = webdriver.Firefox() driver.get('https://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch&LINK_LOC=blasthome') element_download_files = driver.find_element_by_name("QUERYFILE") element_download_files.click() if __name__ == '__main__': main()
This bot gets a response from this page where is element for downloading files from your own PC. So here it is the tag of needed element:
<input type="file" id="upl" name="QUERYFILE">
But I have such traceback:
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: Cannot click <input type=file> elements
Is there a way to click on browse button which is not a HTML button? Or do I need to write a new code and use ? I suspect I can write code which will get BLAST sequences from my files and put it into but I would like to know more about Selenium.
Thanks you for help and attention!
I use this:
- Ubuntu 20.04
- Python 3.8.5
- Selenium 3.141.0
- Mozilla Firefox 87.0 64-bit