Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion dynamic/utility.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
""" Required for replacing html escape characters with their corresponding unicode/ascii characters """
Comment thread Fixed
import html

from termcolor import colored
import requests
from rich.console import Console
Expand Down Expand Up @@ -33,6 +36,8 @@
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.microsoft import EdgeChromiumDriverManager



console = Console()


Expand Down Expand Up @@ -190,6 +195,8 @@ def populate_question_data(self, questions_list):
details of questions with id in the list. Stores the returned
data in the following format:
list( list( question_title, question_link, question_id ) )
Uses html.unescape function to convert html character references
to the corresponding unicode to corresponding unicode characters
"""
with console.status("Getting the questions..."):
try:
Expand All @@ -199,7 +206,7 @@ def populate_question_data(self, questions_list):
sys.exit()
json_ques_data = resp.json()
self.questions_data = [
[item["title"].replace("|", ""), item["question_id"], item["link"]]
[html.unescape(item["title"].replace("|", "")), item["question_id"], item["link"]]
for item in json_ques_data["items"]
]

Expand Down