diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2021-02-10 23:03:28 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2021-02-10 23:03:28 +0800 |
commit | 6fc32e102899ed1a0780e91afbc1c7728b7578e7 (patch) | |
tree | 4ce1d7983aa5eb07df456e5284039f8c232994d7 | |
parent | 92544e7577ae3065d0d100b08f84016a4503d0f0 (diff) |
app/main.py and app/test/test_add_word.py: use class instead of id.
-rw-r--r-- | app/main.py | 4 | ||||
-rw-r--r-- | app/test/test_add_word.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/main.py b/app/main.py index f0e7b34..62bdf2a 100644 --- a/app/main.py +++ b/app/main.py @@ -343,9 +343,9 @@ def userpage(username): freq = x[1]
if isinstance(d[word], list): # d[word] is a list of dates
if freq > 1:
- page += '<p id="new-word"> <a href="%s">%s</a> (<a title="%s">%d</a>) </p>\n' % (youdao_link(word), word, '; '.join(d[word]), freq)
+ page += '<p class="new-word"> <a href="%s">%s</a> (<a title="%s">%d</a>) </p>\n' % (youdao_link(word), word, '; '.join(d[word]), freq)
else:
- page += '<p id="new-word"> <a href="%s">%s</a> <font color="white">(<a title="%s">%d</a>)</font> </p>\n' % (youdao_link(word), word, '; '.join(d[word]), freq)
+ page += '<p class="new-word"> <a href="%s">%s</a> <font color="white">(<a title="%s">%d</a>)</font> </p>\n' % (youdao_link(word), word, '; '.join(d[word]), freq)
elif isinstance(d[word], int): # d[word] is a frequency. to migrate from old format.
page += '<a href="%s">%s</a>%d\n' % (youdao_link(word), word, freq)
diff --git a/app/test/test_add_word.py b/app/test/test_add_word.py index 4fb38bc..01d867f 100644 --- a/app/test/test_add_word.py +++ b/app/test/test_add_word.py @@ -61,7 +61,7 @@ def test_add_word(): elem = driver.find_element_by_xpath('//form[1]/input[1]') # 找到加入我的生词簿按钮 elem.click() - elems = driver.find_elements_by_xpath("//p[@id='new-word']") + elems = driver.find_elements_by_xpath("//p[@class='new-word']") elems[0].location_once_scrolled_into_view driver.save_screenshot('./app/test/test_add_word_pic3.png') |