cheeriojs / cheerio

The fast, flexible, and elegant library for parsing and manipulating HTML and XML.
https://cheerio.js.org
MIT License
28.61k stars 1.64k forks source link

Link element somehow is not closed when parsed in cheerio #1321

Closed pencilcheck closed 5 years ago

pencilcheck commented 5 years ago

Parsing an XML returned by an API, as seen this all looks normal. However when I pass into cheerio somehow when I tried to pull it is seen is unclosed when trying to display its html via cheerio. That is super weird..

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rss version="2.0">
    <channel>
        <copyright>Copyright (c) 2019 Yahoo! Inc. All rights reserved.</copyright>
        <description>Latest Financial News for nyny</description>
        <image>
            <height>45</height>
            <link>http://finance.yahoo.com/q/h?s=nyny</link>
            <title>Yahoo! Finance: nyny News</title>
            <url>http://l.yimg.com/a/i/brand/purplelogo/uh/us/fin.gif</url>
            <width>144</width>
        </image>
        <item>
            <description>We think intelligent long term investing is the way to go. But that doesn&amp;#39;t mean long term investors can avoid big...</description>
            <guid isPermaLink="false">46028474-d1f9-3570-95ce-50af0817b865</guid>
            <link>https://finance.yahoo.com/news/had-bought-empire-resorts-nasdaq-122339706.html?.tsrc=rss</link>
            <pubDate>Mon, 27 May 2019 12:23:39 +0000</pubDate>
            <title>If You Had Bought Empire Resorts (NASDAQ:NYNY) Stock Five Years Ago, You&amp;#39;d Be Sitting On A 61% Loss, Today</title>
        </item>
        <item>
            <description>BOSTON, March 15, 2019 -- Block &amp; Leviton LLP (www.blockesq.com), one of the nation’s leading securities litigation firms representing investors nationwide, is.</description>
            <guid isPermaLink="false">9ba1df84-634b-3100-acc8-6210d6c28a86</guid>
            <link>https://finance.yahoo.com/news/empire-resorts-investigated-block-leviton-224928464.html?.tsrc=rss</link>
            <pubDate>Fri, 15 Mar 2019 22:49:28 +0000</pubDate>
            <title>Empire Resorts Investigated by Block &amp; Leviton LLP For Violations of Federal Securities Laws</title>
        </item>
        <item>
            <description>Casino and gaming stocks have bounced strongly off December lows and could enter new uptrends in coming weeks.</description>
            <guid isPermaLink="false">ce64abf3-1589-3835-a0a3-a5b44aa05db9</guid>
            <link>https://finance.yahoo.com/m/ce64abf3-1589-3835-a0a3-a5b44aa05db9/casino-stocks-may-have.html?.tsrc=rss</link>
            <pubDate>Fri, 18 Jan 2019 15:39:02 +0000</pubDate>
            <title>Casino Stocks May Have Bottomed Out</title>
        </item>
        <item>
            <description>A promising new deal prompted stock of the gaming and resort operator to nearly double in November.</description>
            <guid isPermaLink="false">320a7adf-95d1-3c30-aefb-3e13245c7357</guid>
            <link>https://finance.yahoo.com/news/why-empire-resorts-stock-climbed-132900644.html?.tsrc=rss</link>
            <pubDate>Mon, 10 Dec 2018 13:29:00 +0000</pubDate>
            <title>Why Empire Resorts Stock Climbed 95.8% in November</title>
        </item>
        <item>
            <description>Empire Resorts Executive Chairman Manny Pearlman on teaming up with bet365 to offer sports betting at Resorts World Catskills in New York.</description>
            <guid isPermaLink="false">c59ee96e-2ad8-337d-92ba-7ff2e39b50fb</guid>
            <link>https://finance.yahoo.com/video/ny-casino-planning-offer-sports-162501049.html?.tsrc=rss</link>
            <pubDate>Wed, 21 Nov 2018 16:25:01 +0000</pubDate>
            <title>NY casino planning to offer sports betting</title>
        </item>
        <item>
            <description>NEW YORK, Nov. 16, 2018 -- In new independent research reports released early this morning, Fundamental Markets released its latest key findings for all current investors,.</description>
            <guid isPermaLink="false">e2aaca23-9828-3f91-aa38-6c6800a4f845</guid>
            <link>https://finance.yahoo.com/news/report-developing-opportunities-within-celsius-130000343.html?.tsrc=rss</link>
            <pubDate>Fri, 16 Nov 2018 13:00:00 +0000</pubDate>
            <title>Report: Developing Opportunities within Celsius, Empire Resorts, Owens Corning, Energy Focus, Graham, and Gencor Industries — Future Expectations, Projections Moving into 2018</title>
        </item>
        <item>
            <description>Empire  Resorts, Inc. (NYNY) (together with its subsidiaries,  “Empire”) and an affiliate of bet365  Group Limited (“bet365”) today announced a strategic alliance to  develop a physical and online sportsbook in New York State at Resorts  World Catskills, New York’s newest and largest integrated commercial  casino resort destination with closest proximity to Manhattan.  Empire  and an affiliate of bet365, the world’s largest online sports bookmaker,  entered into a 20-year agreement (the “Sports Wagering Agreement”) to  offer retail sports betting, an online sportsbook and online gaming at  Resorts World Catskills if and when permitted by applicable law.</description>
            <guid isPermaLink="false">fce7b76a-a098-38c5-9450-b9f5ecc836c5</guid>
            <link>https://finance.yahoo.com/news/empire-resorts-bet365-forge-strategic-140000558.html?.tsrc=rss</link>
            <pubDate>Wed, 14 Nov 2018 14:00:00 +0000</pubDate>
            <title>Empire Resorts and bet365 Forge Strategic Alliance to Offer Sports Betting and Online Gaming in New York State at Resorts World Catskills</title>
        </item>
        <item>
            <description>Moody's Investors Service (Moody's) today downgraded Montreign Operating Company, LLC's (Montreign) Corporate Family Rating today to Caa3 from Caa1 and Probability of Default Rating to Caa3-PD from Caa1-PD.  "The downgrade and negative rating outlook consider that despite a slight pickup in Resorts World Catskills' monthly gaming revenue during June and July, the improvement was not enough to alleviate Moody's concern that Montreign will be challenged to support its annual fixed charges of about $75 million going forward," stated Keith Foley, a Senior Vice President at Moody's.  Resorts World Catskills' ramp up in terms of gross gaming revenue continues be at a level well below expectations, and at a rate that Moody's believes will not generate enough EBITDA to cover the company's interest and scheduled principal repayments during the next 12-18 months," added Foley.</description>
            <guid isPermaLink="false">4cf5d3db-6c5d-3d71-b006-2fafa0a5a1b7</guid>
            <link>https://finance.yahoo.com/m/4cf5d3db-6c5d-3d71-b006-2fafa0a5a1b7/montreign-operating-company%2C.html?.tsrc=rss</link>
            <pubDate>Mon, 10 Sep 2018 21:38:08 +0000</pubDate>
            <title>Montreign Operating Company, LLC -- Moody's downgrades Montreign Operating Company, LLC's CFR to Caa3; negative outlook</title>
        </item>
        <item>
            <description>Empire Resorts, Inc. and its subsidiaries has engaged Moelis &amp; Company LLC as exclusive financial advisor to assist in the Company’s review of opportunities in online gaming, sports betting and interactive gaming.</description>
            <guid isPermaLink="false">d334c3f7-68d3-3e64-af60-0938053c0c42</guid>
            <link>https://finance.yahoo.com/news/empire-resorts-engages-moelis-company-120000729.html?.tsrc=rss</link>
            <pubDate>Thu, 09 Aug 2018 12:00:00 +0000</pubDate>
            <title>Empire Resorts Engages Moelis &amp; Company LLC as Exclusive Financial Advisor</title>
        </item>
        <language>en-US</language>
        <lastBuildDate>Sun, 16 Jun 2019 03:23:52 +0000</lastBuildDate>
        <link>http://finance.yahoo.com/q/h?s=nyny</link>
        <title>Yahoo! Finance: nyny News</title>
    </channel>
</rss>
fb55 commented 5 years ago

Are you using xmlMode: true? Otherwise, some tags that don't require it will not be closed.