我正在尝试管理https://www.vocabulary.com/中的单词列表。 但是,我不知道如何在列表中添加一个单词。 网站页面源类似于:
<input type="hidden" id="entryTemplate" value="<li class="entry" >
<a tabindex="-1" class="deleteEntry ss-delete" title="delete this entry" href="javascript:void(0)"></a>
<div class="field word"><input class="wordInput" type="text" value="" autocapitalize="off" placeholder="add a word"></div>
<div class="field definition"></div>
<div class="notesAndExamples grid grid-2 responsive">
<div class="col examples">
<label>Example Sentence:</label>
<div class="value">
<textarea placeholder="Write your own example sentence..."></textarea>
<button class="remove" ><i class="ss-delete"></i> Remove Example</button>
</div>
<button class="browseExamples"><i class="ss-openbook icon"></i> Browse Example Sentences</button>
</div>
<div class="col notes">
<label>Notes:</label>
<textarea maxlength="500"></textarea>
</div>
</div>
</li>" >
当我尝试将单词添加到列表中
inputWord = driver.find_element_by_id("entryTemplate")
inputWord.click()
inputWord.send_keys('expire')
输出
回溯(最近通话最近): 在第16行的文件“ c:/MY_WORK/autoEnglish/Selenium.py” inputWord.click() 单击文件“ C:\ Users \ jatian \ AppData \ Local \ Programs \ Python \ Python38 \ lib \ site-> packages \ selenium \ webdriver \ remote \ webelement.py”,单击行80 self._execute(Command.CLICK_ELEMENT) _execute中的第633行的文件“ C:\ Users \ jatian \ AppData \ Local \ Programs \ Python \ Python38 \ lib \ site-packages \ selenium \ webdriver \ remote \ webelement.py” 返回self._parent.execute(command,params) 在执行的文件“ C:\ Users \ jatian \ AppData \ Local \ Programs \ Python \ Python38 \ lib \ site-packages \ selenium \ webdriver \ remote \ webdriver.py”中执行 self.error_handler.check_response(响应) 文件“ C:\ Users \ jatian \ AppData \ Local \ Programs \ Python \ Python38 \ lib \ site-packages \ selenium \ webdriver \ remote \ errorhandler.py”,行242,在check_response中 引发exception_class(消息,屏幕,堆栈跟踪) selenium.common.exceptions.ElementNotInteractableException:消息:元素不可交互 (会话信息:chrome = 81.0.4044.92)