How to auto search for words in list in python
I have a list like that: "Covid19" , "worm", "Neodermis", "Proglottid" ...
I need to go to Pubmed to search related-info,
I try my code like below
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
browser = webdriver.Chrome()
browser.get('https://pubmed.ncbi.nlm.nih.gov/')
print("Enter a keyword to search: ", end='')
keyword = input()
#by_class_name
elem = browser.find_element(By.CLASS_NAME, 'search-input') # Find the search box
elem.send_keys(keyword + Keys.ENTER)
browser.quit()开发者_运维问答
it's get error in my code. I'm not sure maybe my search-box is located wrong placd?
Do any one can give me some suggestion?
精彩评论