5j9 / wikitextparser

A Python library to parse MediaWiki WikiText
GNU General Public License v3.0
288 stars 22 forks source link

Hang when parse large html text #89

Closed lehoanganh298 closed 3 years ago

lehoanganh298 commented 3 years ago

I'm parsing a wikitext from a wikipedia page (wikitext), which has a large HTML script. Parsing this wikitext seems to lead to endless loop and consume CPU forever, without any error messages. It's probably because of this HTML script (parsing only this script also lead to hanging up): {{Infobox football tournament\n| name = Siêu cúp Đức\n| logo = [[Tập tin:DFL-Supercup logo (2017).png|250px]]\n| caption =\n| organiser = {{nowrap|Deutsche Fußball Liga}}\n| founded = {{nowrap|1987<br>(không tổ chức từ 1997–2009)}}\n| region = Đức\n| number of teams = 2\n| current champions = [[FC Bayern Munich|Bayern Munich]]<br>(8 lần)\n| most successful club = [[FC Bayern Munich|Bayern Munich]]<br>(8 lần)\n| broadcasters = [[:en:ZDF|ZDF]]<br/>[[:en:List of Bundesliga broadcasters|Danh sách đài phát Bundesliga]]\n| motto =\n| website = [http://www.bundesliga.de/de/supercup/ Trang web chính thức]\n| current = [[Siêu cúp Đức 2019]]\n}}\'\'\'DFL-Supercup\'\'\' ({{IPA-de|ˈdeː ʔɛf ɛlː zuːpɐkap|IPA}}) hay còn gọi là \'\'\'Siêu cúp Đức \'\'\'là một giải thi đấu ở Đức, diễn ra mỗi năm một lần giữa đội vô địch [[Giải bóng đá vô địch quốc gia Đức|Bundesliga]] và đội vô địch [[Cúp quốc gia Đức]]. Siêu cúp Đức được quản lý bởi cơ quan Deutsche Fußball Liga - DFL\n\n== Lịch sử ==\nĐược thành lập từ năm 1987, giải đã được thay thế bằng [[Cúp Liên đoàn bóng đá Đức|Cúp Liên đoàn Đức]] (\'\'DFB-Ligapokal\'\') trong giai đoạn từ 1997-2009.\xa0Trong năm 2008, mặc dù không được DFB chính thức công nhận, nhưng trận đấu trở lại như T-Home Supercup, với các nhà vô địch Bundesliga [[FC Bayern München|Bayern München]] và các cầu thủ của [[Borussia Dortmund]], vô địch [[Cúp bóng đá Đức|DFB-Pokal]].\xa0Trận đấu là thay thế cho DFB-Ligapokal, đã bị hủy trong mùa giải, do lịch trình dày đặc do UEFA Euro 2008 gây ra. Siêu cúp đã được phục hồi từ mùa giải 2010-11 tại cuộc họp chung hàng năm của Liên đoàn Bóng đá Đức vào ngày 10 tháng 11 năm 2009.<ref>{{chú thích web|url=https://www.fifa.com/worldfootball/clubfootball/news/newsid=1131506.html|title=Super Cup starts again|work=[[FIFA]]|date=ngày 10 tháng 11 năm 2009|accessdate=ngày 12 tháng 11 năm 2009}}</ref>\xa0Siêu cúp từ đó được gọi là DFL-Supercup bởi vì nó được điều hành bởi Deutsche Fußball Liga, trước đây được gọi là DFB Supercup bởi vì nó được điều hành bởi Deutscher Fußball-Bund (tiếng Anh: Hiệp hội bóng đá Đức).\n\nKể từ năm 2010, ngược lại với DFB Supercup, nếu một đội vô địch cả hai giải (Bundesliga và cúp), đội chiến thắng sẽ thi đấu với đội nhì Bundesliga. Không có thêm thời gian được chơi trong trường hợp hòa sau 90 phút, trận đấu sau đó được quyết định bởi một loạt đá luân lưu.\n\n== Trận đấu ==\n[[Tập tin:Deutscher_Supercup.JPG|phải|nhỏ|200x200px|Giải thưởng DFB-Supercup được tài trợ năm 1992\n]]\n{| class="wikitable" style="margin-bottom: 10px;"\n! style="width:50px" |Năm\n! style="width:200px" |Đội vô địch Bundesliga\n! style="width:120px" |Tỉ số\n! style="width:200px" |Đội vô địch DFB-Cup<br>\n{{Refn|Unless noted otherwise.|name=note|group=lower-alpha}}\n! style="width:250px" | Venue\n|-\n| align="center" colspan="5" style="background-color:#F5FAFF" | \'\'\'DFB-Supercup\'\'\'\n|-\n| style="text-align:center" | 1987\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'2–1\'\'\'\n| [[Hamburger SV]]\n| Waldstadion, [[Frankfurt am Main|Frankfurt]]\n|-\n| style="text-align:center" | 1988\n| \'\'\'[[SV Werder Bremen|Werder Bremen]]\'\'\'\n| style="text-align:center" | \'\'\'2–0\'\'\'\n| [[Eintracht Frankfurt]]\n| Waldstadion, [[Frankfurt am Main|Frankfurt]]\n|-\n| style="text-align:center" | 1989\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'3–4\'\'\'\n| \'\'\'[[Borussia Dortmund]]\'\'\'\n| Fritz-Walter-Stadion, [[Kaiserslautern]]\n|-\n| style="text-align:center" | 1990\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'4–1\'\'\'\n| 1. FC Kaiserslautern\n| Wildparkstadion, [[Karlsruhe]]\n|-\n| style="text-align:center" | 1991{{Refn|The 1991 edition included four teams, the league and cup winners of the former East and West Germany.|group=lower-alpha}}\n| \'\'\'1. FC Kaiserslautern\'\'\'{{Refn|1. FC Kaiserslautern won the [[1991 DFB-Supercup#League champions|semi-final match]] 2–1 against [[F.C. Hansa Rostock|Hansa Rostock]] (double-winners of the [[1990–91 NOFV-Oberliga]] và [[1990–91 NOFV-Pokal]]) at the [[Ostseestadion]], [[Rostock]].|group=lower-alpha}}\n| style="text-align:center" | \'\'\'3–1\'\'\'\n| [[SV Werder Bremen|Werder Bremen]]{{Refn|Werder Bremen won the [[1991 DFB-Supercup#Cup winners|semi-final match]] 1–0 against [[Eisenhüttenstädter FC Stahl|Stahl Eisenhüttenstadt]] (runners-up of the [[1990–91 NOFV-Pokal]]) at the [[Stadion an der Bremer Brücke|Piepenbrockstadion an der Bremer Brücke]], [[Osnabrück]].|group=lower-alpha}}\n| Niedersachsenstadion, [[Hannover|Hanover]]\n|-\n| style="text-align:center" | 1992\n| \'\'\'[[VfB Stuttgart]]\'\'\'\n| style="text-align:center" | \'\'\'3–1\'\'\'\n| [[Hannover 96]] \'\'(II)\'\'\n| Niedersachsenstadion, [[Hannover|Hanover]]\n|-\n| style="text-align:center" | 1993\n| \'\'\'[[SV Werder Bremen|Werder Bremen]]\'\'\'\n| style="text-align:center" | \'\'\'2–2\'\'\' {{Aet}} {{Pso|\'\'\'7–6\'\'\'}}\n| [[Bayer Leverkusen]]\n| Ulrich-Haberland-Stadion, [[Leverkusen]]\n|-\n| style="text-align:center" | 1994\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'1–3\'\'\' {{Aet}}\n| \'\'\'[[SV Werder Bremen|Werder Bremen]]\'\'\'\n| Olympiastadion, [[München|Munich]]\n|-\n| style="text-align:center" | 1995\n| \'\'\'[[Borussia Dortmund]]\'\'\'\n| style="text-align:center" | \'\'\'1–0\'\'\'\n| [[Borussia Mönchengladbach]]\n| Rheinstadion, Düsseldorf\n|-\n| style="text-align:center" | 1996\n| \'\'\'[[Borussia Dortmund]]\'\'\'\n| style="text-align:center" | \'\'\'1–1\'\'\' {{Aet}} {{Pso|\'\'\'4–3\'\'\'}}\n| 1. FC Kaiserslautern \'\'(II)\'\'\n| Carl-Benz-Stadion, Mannheim\n|-\n| align="center" colspan="5" style="background-color:#F5FAFF" | \'\'\'DFL-Supercup\'\'\'\n|-\n| style="text-align:center" | 2010\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'2–0\'\'\'\n| Schalke 04{{Refn|Bundesliga runners-up.|name=blru|group=lower-alpha}}\n| impuls arena, Augsburg\n|-\n| style="text-align:center" | 2011\n| \'\'\'[[Borussia Dortmund]]\'\'\'\n| style="text-align:center" | \'\'\'0–0\'\'\'{{Refn|No extra time was played.|name=et|group=lower-alpha}} {{Pso|\'\'\'3–4\'\'\'}}\n| \'\'\'Schalke 04\'\'\'\n| Veltins-Arena, Gelsenkirchen\n|-\n| style="text-align:center" | 2012\n| \'\'\'[[Borussia Dortmund]]\'\'\'\n| style="text-align:center" | \'\'\'1–2\'\'\'\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'{{Refn|name=blru|group=lower-alpha}}\n| Allianz Arena, [[München|Munich]]\n|-\n| style="text-align:center" | 2013\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'2–4\'\'\'\n| \'\'\'[[Borussia Dortmund]]\'\'\'{{Refn|name=blru|group=lower-alpha}}\n| Signal Iduna Park, Dortmund\n|-\n| style="text-align:center" | 2014\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'0–2\'\'\'\n| \'\'\'[[Borussia Dortmund]]\'\'\'{{Refn|name=blru|group=lower-alpha}}\n| Signal Iduna Park, Dortmund\n|-\n| style="text-align:center" | 2015\n|\'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'1–1\'\'\'{{Refn|name=et|group=lower-alpha}} {{Pso|\'\'\'4–5\'\'\'}}\n| \'\'\'VfL Wolfsburg\'\'\'\n| Volkswagen Arena, Wolfsburg\n|-\n| style="text-align:center" | 2016\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'2–0\'\'\'\n| \'\'\'[[Borussia Dortmund]]\'\'\'{{Refn|name=blru|group=lower-alpha}}\n| Signal Iduna Park, Dortmund\n|-\n| style="text-align:center" | 2017\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'2–2\'\'\'{{Refn|name=et|group=lower-alpha}} {{Pso|\'\'\'5–4\'\'\'}}\n| \'\'\'[[Borussia Dortmund]]\'\'\'\n| Signal Iduna Park, Dortmund\n|-\n| style="text-align:center" | 2018\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'5–0\'\'\'\n| [[Eintracht Frankfurt]]\n| Commerzbank Arena, Frankfurt\n|-\n| style="text-align:center" | 2019\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'0–2\'\'\'\n| \'\'\'[[Borussia Dortmund]]\'\'\'{{Refn|name=blru|group=lower-alpha}}\n| Signal Iduna Park, Dortmund\n|-\n| style="text-align:center" | 2020\n| \'\'\'[[FC Bayern München|Bayern München]]\'\'\'\n| style="text-align:center" | \'\'\'3–2\'\'\'\n| \'\'\'[[Borussia Dortmund]]\'\'\'{{Refn|name=blru|group=lower-alpha}}\n| Allianz Arena, Munich\n|}\n\n== Thống kê ==\n[[Tập tin:DFL_Supercup_01.jpg|phải|nhỏ|316x316px|Cúp\xa0DFL-Supercup]]\n\n=== Theo đội ===\n{| class="wikitable sortable" style="text-align: center; margin-bottom: 82px;"\n!Đội\n!Vô địch\n!Nhì\n!Năm thắng\n!Năm thua\n|-\n|[[FC Bayern München|Bayern München]]\n| 8\n| 6\n| 1987, 1990, 2010, 2012, 2016, 2017, 2018, 2020\n| 1989, 1994, 2013, 2014, 2015, 2019\n|-\n| [[Borussia Dortmund]]\n| 6\n| 5\n| 1989, 1995, 1996, 2013, 2014, 2019\n| 2011, 2012, 2016, 2017, 2020\n|-\n| [[SV Werder Bremen|Werder Bremen]]\n| 3\n| 1\n| 1988, 1993, 1994\n| 1991\n|-\n| 1. FC Kaiserslautern\n| 1\n| 2\n| 1991\n| 1990, 1996\n|-\n| [[FC Schalke 04|Schalke 04]]\n| 1\n| 1\n| 2011\n| 2010\n|-\n| [[VfB Stuttgart]]\n| 1\n| —\n| 1992\n| —\n|-\n| [[VfL Wolfsburg]]\n| 1\n| —\n| 2015\n| —\n|-\n| [[Eintracht Frankfurt]]\n| —\n| 2\n| —\n| 1988, 2018\n|-\n| [[Hamburger SV]]\n| —\n| 1\n| —\n| 1987\n|-\n| [[Hannover 96]]\n| —\n| 1\n| —\n| 1992\n|-\n| [[Bayer Leverkusen]]\n| —\n| 1\n| —\n| 1993\n|-\n| [[Borussia Mönchengladbach]]\n| —\n| 1\n| —\n| 1995\n|}\n\n=== Theo cách tham gia ===\n{| class="wikitable sortable" style="margin-bottom: 10px;"\n! Cạnh tranh\n!Vô địch\n!Á quân\n|-\n|Vô địch Bundesliga\n| align="center" |13\n| align="center" |8\n|-\n|Vô địch Cúp quốc gia\n| align="center" |4\n| align="center" |10\n|-\n|Á quân Bundesliga\n| align="center" |4\n| align="center" |3\n|}\n\n== Ghi bàn hàng đầu ==\n\'\'\'Đậm\'\'\' cho thấy cầu thủ đang thi đấu trong hệ thống bóng đá đức.<ref>{{chú thích web|url=http://www.worldfootball.net/alltime_goalgetter/supercup/tore/1/|title=All-time top goalscorers|publisher=worldfootball.net}}</ref>\n{| class="wikitable" style="margin-bottom: 82px;"\n!Xếp hạng\n!Cầu thủ\n!Đội\n!Số bàn\n|-\n! 1\n| {{Biểu tượng lá cờ|POL}} \'\'\'[[Robert Lewandowski]]\'\'\'\n| [[Borussia Dortmund]], \'\'\'[[FC Bayern Munich|Bayern Munich]]\'\'\'\n| style="text-align:center" | 5\n|-\n! 2\n| {{Biểu tượng lá cờ|NZL}} [[Wynton Rufer]]\n| [[SV Werder Bremen|Werder Bremen]]\n| style="text-align:center" | 4\n|-\n! rowspan="3" | 3\n| {{Biểu tượng lá cờ|GER}} \'\'\'[[Thomas Müller]]\'\'\'\n| \'\'\'[[FC Bayern Munich|Bayern Munich]]\'\'\'\n| style="text-align:center" | 3\n|-\n| {{Biểu tượng lá cờ|NED}} [[Arjen Robben]]\n| [[FC Bayern Munich|Bayern Munich]]\n| style="text-align:center" | 3\n|-\n| {{Biểu tượng lá cờ|GER}} [[Jürgen Wegmann]]\n| [[Borussia Dortmund]], [[FC Bayern Munich|Bayern Munich]]\n| style="text-align:center" | 3\n|-\n! rowspan="4" | 6\n| {{Biểu tượng lá cờ|GAB}} [[Pierre-Emerick Aubameyang]]\n| [[Borussia Dortmund]]\n| style="text-align:center" | 2\n|-\n| {{Biểu tượng lá cờ|GER}} [[Günter Breitzke]]\n| [[Borussia Dortmund]]\n| style="text-align:center" | 2\n|-\n| {{Biểu tượng lá cờ|GER}} [[Jürgen Degen]]\n| [[1. FC Kaiserslautern]]\n| style="text-align:center" | 2\n|-\n| {{Biểu tượng lá cờ|GER}} \'\'\'[[Marco Reus]]\'\'\'\n| \'\'\'[[Borussia Dortmund]]\'\'\'\n| style="text-align:center" | 2\n|}\n\n== Trận đấu không chính thức ==\nĐội vô địch giải đấu của Đức đã gặp đội vô địch cúp quốc gia nhiều lần trong những trận đấu không chính thức.\xa0<div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="name" class="cx-template-editor-param-key">name</span><span data-key="name" title="The name of the footnote. Corresponds to the &quot;name&quot; attribute of the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="name" id="cite_ref-note_3-1-name-" style="position: relative;">note</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-note_3-1-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="name" class="cx-template-editor-param-key">name</span><span data-key="name" title="The name of the footnote. Corresponds to the &quot;name&quot; attribute of the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="name" id="cite_ref-note_3-1-name-" style="position: relative;">note</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-note_3-1-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-10-1-" style="position: relative;">The 1940 German champions, Schalke 04, and the 1940 Tschammerpokal winners, Dresdner SC, faced each other on ngày 16 tháng 3 năm 1941.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-10-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-10-1-" style="position: relative;">The 1940 German champions, Schalke 04, and the 1940 Tschammerpokal winners, Dresdner SC, faced each other on ngày 16 tháng 3 năm 1941.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-10-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-11-1-" style="position: relative;">The 1975–76 Bundesliga winners, Borussia Mönchengladbach, and the 1975–76 DFB-Pokal winners, Hamburger SV, faced each other on ngày 8 tháng 1 năm 1977.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-11-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-11-1-" style="position: relative;">The 1975–76 Bundesliga winners, Borussia Mönchengladbach, and the 1975–76 DFB-Pokal winners, Hamburger SV, faced each other on ngày 8 tháng 1 năm 1977.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-11-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-12-1-" style="position: relative;">The 1981–82 Bundesliga winners, Hamburger SV, and the 1981–82 DFB-Pokal winners, Bayern Munich, faced each other on ngày 2 tháng 4 năm 1983.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-12-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-12-1-" style="position: relative;">The 1981–82 Bundesliga winners, Hamburger SV, and the 1981–82 DFB-Pokal winners, Bayern Munich, faced each other on ngày 2 tháng 4 năm 1983.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-12-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title">Pso</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">1</span></div><div class="cx-template-editor-param-value" data-key="1" style="position: relative;">\'\'\'2–4\'\'\'</div></div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="name" class="cx-template-editor-param-key">name</span><span data-key="name" title="The name of the footnote. Corresponds to the &quot;name&quot; attribute of the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="name" id="cite_ref-et_8-3-name-" style="position: relative;">et</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-et_8-3-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="name" class="cx-template-editor-param-key">name</span><span data-key="name" title="The name of the footnote. Corresponds to the &quot;name&quot; attribute of the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="name" id="cite_ref-et_8-3-name-" style="position: relative;">et</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-et_8-3-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-13-1-" style="position: relative;">DFB-Pokal runners-up.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-13-group-" style="position: relative;">lower-alpha</div></div></div><div class="cx-template-editor-source-container" lang="en" dir="ltr" style="display: none;"><div class="cx-template-editor-source"><div class="cx-template-editor-title" title="This template is used to create footnotes in Wikipedia, as an alternative and complement to the <ref>tag.">Refn</div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="1" class="cx-template-editor-param-key">content</span><span data-key="1" title="The content of the footnote." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="1" id="cite_ref-13-1-" style="position: relative;">DFB-Pokal runners-up.</div></div><div class="cx-template-editor-param"><div class="cx-template-editor-param-title"><span id="group" class="cx-template-editor-param-key">group</span><span data-key="group" title="The reference group. Corresponds to the &quot;group&quot; attribute on the <ref>tag." class="cx-template-editor-param-desc"></span></div><div class="cx-template-editor-param-value" data-key="group" id="cite_ref-13-group-" style="position: relative;">lower-alpha</div></div></div>\n I know this script is not in right format (without several closing tags), but breaking down this script into smaller parts and parsing each of them works and not hanging, although parsing some parts is a little slow. Is it because the HTML is too large, or is there something wrong with it? I'm using wikitextparser version 0.47.0.

karimvision commented 3 years ago

This article hangs too https://en.wikipedia.org/wiki/Results_of_the_2019_Canadian_federal_election_by_riding

5j9 commented 3 years ago

Sorry that it took so long to fix this critical issue. Fix is released as v0.47.2.