Skip to content

Commit

Permalink
Deepsource: minor improvements in code
Browse files Browse the repository at this point in the history
  • Loading branch information
metavinayak committed Oct 2, 2021
1 parent 94ee3ac commit 27e3968
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions vocab_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ def get_ans():
wiki_sector = driver.find_element_by_class_name("kp-wholepage")
descs = wiki_sector.find_elements_by_tag_name("span")
for desc in descs:
if len(desc.text)>10:
if (desc.text.lower()) != query.lower():
print(desc.text)
if len(desc.text)>10 and (desc.text.lower()) != query.lower():
print(desc.text)
defs.append(desc)

except:
Expand All @@ -167,9 +166,9 @@ def get_ans():
print("I can't find your word... \n Please make sure that the computer has an active internet connection and retry.\nIf all else fails, call the developer for help if this issue is recurring")
try:
# This part still broken - need to figure out how to fix About Featured Snippets
if ("..." or '' or ' ' or "About Featured Snippets") in defs[(len(defs)-1)]:
if ("..." or '' or ' ' or "About Featured Snippets") in defs[-1]:
error_list.append(queries[index])
elif defs[(len(defs)-1)] == (None or False):
elif defs[-1] == (None or False):
error_list.append(queries[index])
except:
pass
Expand Down Expand Up @@ -228,7 +227,7 @@ def main():
print("Finished!")
print()
exitcon = input("Press any key to go again or type 'exit' or 'quit' to close the program: ")
if exitcon == 'quit' or exitcon == 'exit':
if exitcon in ('quit', 'exit'):
loopon = False
driver.close()
sys.exit(0)
Expand Down

0 comments on commit 27e3968

Please sign in to comment.