geel9 / SteamAuth

A C# library that provides vital Steam Mobile Authenticator functionality
MIT License
278 stars 105 forks source link

IndexOutOfRangeException in SteamGuardAccount.FetchConfirmations() #60

Open fjch1997 opened 8 years ago

fjch1997 commented 8 years ago

This issue is simlar to #51 so we can probably produce a fix at the same time.

I was able to catch this exception during debugging. The original HTML is like this.

<!DOCTYPE html>
<html class=" responsive touch" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
        <meta name="theme-color" content="#171a21">
        <title>Steam Community :: Confirmations</title>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

    <link href="https://steamcommunity-a.akamaihd.net/public/shared/css/motiva_sans.css?v=LdCeTJr_TZ6A" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/buttons.css?v=DqDbwtwoUvC4" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/shared_global.css?v=zTXBgMbKPLMZ" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/globalv2.css?v=xwH7fFZlzxJe" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/modalContent.css?v=.vXD4gU69vdZP" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/mobile/styles_mobileconf.css?v=7eOknd5U_Oiy" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/motiva_sans.css?v=LdCeTJr_TZ6A" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/html5.css?v=.MtSlvoLZL0Tb" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/economy.css?v=iQbF3P_l9GzK" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/trade.css?v=waXflBHgCJM2" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/profile_tradeoffers.css?v=dV0KLdJys6M3" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/shared_responsive.css?v=fnIXQFFIqv9g" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/header.css?v=zVGNlnB7-F9B" rel="stylesheet" type="text/css" >
            <script>
                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

                ga('create', 'UA-33779068-1', 'auto', {
                    'sampleRate': 0.4               });
                ga('set', 'dimension1', true );
                ga('set', 'dimension2', 'Steam Mobile App' );
                ga('set', 'dimension3', 'mobileconf' );
                ga('set', 'dimension4', "mobileconf\/conf" );
                ga('send', 'pageview');

            </script>
            <script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/prototype-1.7.js?v=.55t44gwuwgvw"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/scriptaculous/_combined.js?v=9XVsa_Ni33oN&amp;l=english&amp;load=effects,controls,slider,dragdrop"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/global.js?v=Rnp1sQq2nwPg&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/jquery-1.11.1.min.js?v=.isFTSRckeNhC"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/shared/javascript/tooltip.js?v=._0UFXFGgvme-"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/shared/javascript/shared_global.js?v=tVoURzwqxPuO&amp;l=english"></script>
<script type="text/javascript">$J = jQuery.noConflict();
if ( typeof JSON != 'object' || !JSON.stringify || !JSON.parse ) { document.write( "<scr" + "ipt type=\"text\/javascript\" src=\"https:\/\/steamcommunity-a.akamaihd.net\/public\/javascript\/json2.js?v=pmScf4470EZP&amp;l=english\"><\/script>\n" ); };
</script><script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/jquery-ui-1.9.2.min.js?v=.ILEZTVPIP_6a"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/mobile/mobileconf.js?v=gzsr7wSdWAPR&amp;l=english&amp;mobileClientType=android"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/economy_common.js?v=tsXdRVB0yEaR&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/economy.js?v=6XKs2vVBvxm9&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/modalv2.js?v=dfMhuy-Lrpyo&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/modalContent.js?v=O5vbf725l6-I&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/shared/javascript/shared_responsive_adapter.js?v=qLEcRmcHn-kc&amp;l=english"></script>

            <link rel="image_src" href="https://steamcommunity-a.akamaihd.net/public/shared/images/responsive/share_steam_logo.png">

            <script type="text/javascript">
            $J(function() {
                                                    window.location='steammobile://settitle?title=' + encodeURIComponent( "Confirmations" );
                            });
        </script>
    </head>
<body class=" responsive_page">

<div class="responsive_page_frame no_header">

        <div class="responsive_local_menu_tab">

        </div>

        <div class="responsive_page_menu_ctn localmenu">
            <div class="responsive_page_menu"  id="responsive_page_local_menu">
                <div class="localmenu_content">
                </div>
            </div>
        </div>

        <div class="responsive_page_content_overlay">

        </div>

        <div class="responsive_fixonscroll_ctn nonresponsive_hidden no_menu">
        </div>

    <div class="responsive_page_content">

        <script type="text/javascript">
    g_sessionID = "8888888888888888888888";
    g_steamID = "88888888888888888";

    // We always want to have the timezone cookie set for PHP to use
    setTimezoneCookies();

    $J( function() {

        InitMiniprofileHovers();
        InitEmoticonHovers();
        window.BindCommunityTooltip = function( $Selector ) { $Selector.v_tooltip( {'tooltipClass': 'community_tooltip', 'dataName': 'communityTooltip' } ); };
        BindCommunityTooltip( $J('[data-community-tooltip]') );
    });

    $J( function() { InitEconomyHovers( "https:\/\/steamcommunity-a.akamaihd.net\/public\/css\/skin_1\/economy.css?v=iQbF3P_l9GzK", "https:\/\/steamcommunity-a.akamaihd.net\/public\/javascript\/economy_common.js?v=tsXdRVB0yEaR&l=english", "https:\/\/steamcommunity-a.akamaihd.net\/public\/javascript\/economy.js?v=6XKs2vVBvxm9&l=english" );});</script>
        <div class="responsive_page_template_content">

                <div id="mobileconf_list">
        <div class="mobileconf_list_entry" id="conf1080296709" data-confid="1080296709" data-key="18144518417433075267" data-cancel="Cancel" data-accept="Create Listing" >
    <div class="mobileconf_list_entry_content">
        <div class="mobileconf_list_entry_icon">
            <div style="border: 1px solid transparent;border-color: #D2D2D2;"><img src="https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrguDIH6Z2uFCePfbDjEtCJ3-VVGvMZKM-UWgSddCNIZkb2tNi4u6gkwRUyOBV-IQAdIptMzF1w25DgSULTY5zoxSg_rJicTKG_iHB4cJ89w/32fx32f" srcset="https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrguDIH6Z2uFCePfbDjEtCJ3-VVGvMZKM-UWgSddCNIZkb2tNi4u6gkwRUyOBV-IQAdIptMzF1w25DgSULTY5zoxSg_rJicTKG_iHB4cJ89w/32fx32f 1x, https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrguDIH6Z2uFCePfbDjEtCJ3-VVGvMZKM-UWgSddCNIZkb2tNi4u6gkwRUyOBV-IQAdIptMzF1w25DgSULTY5zoxSg_rJicTKG_iHB4cJ89w/32fx32fdpx2x 2x"></div>        </div>
        <!--div class="mobileconf_offers_summary_chevron">
            &#x3009;
        </div-->
                    <div class="mobileconf_list_checkbox">
                <input id="multiconf_1080296709" data-confid="1080296709" data-key="18144518417433075267" value="1" type="checkbox">
            </div>
                <div class="mobileconf_list_entry_description">
            <div>Sell - Immortal Treasure I 2016</div>
            <div> ¥ 1,150 (¥ 1,000)</div>
            <div>30 minutes ago</div>
        </div>
    </div>

    <div class="mobileconf_list_entry_sep"></div>
</div>
    </div>
    <div id="mobileconf_done" class="mobileconf_done mobileconf_header" style="display: none">
        <div>All done</div>
        <div>You're all done, there's nothing left to confirm.</div>
    </div>

<div id="mobileconf_details" style="display: none">
</div>

<div id="mobileconf_buttons" style="display: none">
    <div>
    <div class="mobileconf_button mobileconf_button_cancel">
    </div><div class="mobileconf_button mobileconf_button_accept">
    </div>
    </div>
</div>

<div id="mobileconf_throbber" style="display: none">
    <div style="text-align:center; margin: auto;">
        <img src="https://steamcommunity-a.akamaihd.net/public/images/login/throbber.gif" alt="Loading">
    </div>
</div>

        </div>  <!-- responsive_page_legacy_content -->

            <div id="footer_spacer"></div>
    <div id="footer_responsive_optin_spacer"></div>
    <div id="footer">
        <div class="footer_content">
            <span id="footerLogo"><img src="https://steamcommunity-a.akamaihd.net/public/images/skin_1/footerLogo_valve.png?v=1" width="96" height="26" border="0" alt="Valve Logo" /></span>
            <span id="footerText">
                &copy; Valve Corporation. All rights reserved. All trademarks are property of their respective owners in the US and other countries.<br/>Some geospatial data on this website is provided by <a href="https://steamcommunity.com/linkfilter/?url=http://www.geonames.org" target="_blank" rel="noreferrer">geonames.org</a>.                <br>
                                    <span class="valve_links">
                        <a href="http://store.steampowered.com/privacy_agreement/" target="_blank">Privacy Policy</a>
                        &nbsp; | &nbsp;<a href="http://www.valvesoftware.com/legal.htm" target="_blank">Legal</a>
                        &nbsp;| &nbsp;<a href="http://store.steampowered.com/subscriber_agreement/" target="_blank">Steam Subscriber Agreement</a>
                    </span>
                            </span>
        </div>
                    <div class="responsive_optin_link">
                <div class="btn_medium btnv6_grey_black" onclick="Responsive_RequestMobileView()">
                    <span>View mobile website</span>
                </div>
            </div>
            </div>

    </div>  <!-- responsive_page_content -->

</div>  <!-- responsive_page_frame -->
</body>
</html>

I repeatedly called this method on the same steam account and it produced the same result. So i guess this isn't a random case. It's just the way Steam generate its HTML and we should take that into consideration when parsing it.

As you can see from the HTML above there are two data-confid and two data-key attribute per confirmation. But only 1 confDescRegex result.

Then, I added another confirmation to my account. Called FetchConfirmation and the HTML is like this

<!DOCTYPE html>
<html class=" responsive touch" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
        <meta name="theme-color" content="#171a21">
        <title>Steam Community :: Confirmations</title>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

    <link href="https://steamcommunity-a.akamaihd.net/public/shared/css/motiva_sans.css?v=LdCeTJr_TZ6A" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/buttons.css?v=DqDbwtwoUvC4" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/shared_global.css?v=zTXBgMbKPLMZ" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/globalv2.css?v=xwH7fFZlzxJe" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/modalContent.css?v=.vXD4gU69vdZP" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/mobile/styles_mobileconf.css?v=7eOknd5U_Oiy" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/motiva_sans.css?v=LdCeTJr_TZ6A" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/html5.css?v=.MtSlvoLZL0Tb" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/economy.css?v=iQbF3P_l9GzK" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/trade.css?v=waXflBHgCJM2" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/profile_tradeoffers.css?v=dV0KLdJys6M3" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/shared/css/shared_responsive.css?v=fnIXQFFIqv9g" rel="stylesheet" type="text/css" >
<link href="https://steamcommunity-a.akamaihd.net/public/css/skin_1/header.css?v=zVGNlnB7-F9B" rel="stylesheet" type="text/css" >
            <script>
                (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

                ga('create', 'UA-33779068-1', 'auto', {
                    'sampleRate': 0.4               });
                ga('set', 'dimension1', true );
                ga('set', 'dimension2', 'Steam Mobile App' );
                ga('set', 'dimension3', 'mobileconf' );
                ga('set', 'dimension4', "mobileconf\/conf" );
                ga('send', 'pageview');

            </script>
            <script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/prototype-1.7.js?v=.55t44gwuwgvw"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/scriptaculous/_combined.js?v=9XVsa_Ni33oN&amp;l=english&amp;load=effects,controls,slider,dragdrop"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/global.js?v=Rnp1sQq2nwPg&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/jquery-1.11.1.min.js?v=.isFTSRckeNhC"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/shared/javascript/tooltip.js?v=._0UFXFGgvme-"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/shared/javascript/shared_global.js?v=tVoURzwqxPuO&amp;l=english"></script>
<script type="text/javascript">$J = jQuery.noConflict();
if ( typeof JSON != 'object' || !JSON.stringify || !JSON.parse ) { document.write( "<scr" + "ipt type=\"text\/javascript\" src=\"https:\/\/steamcommunity-a.akamaihd.net\/public\/javascript\/json2.js?v=pmScf4470EZP&amp;l=english\"><\/script>\n" ); };
</script><script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/jquery-ui-1.9.2.min.js?v=.ILEZTVPIP_6a"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/mobile/mobileconf.js?v=gzsr7wSdWAPR&amp;l=english&amp;mobileClientType=android"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/economy_common.js?v=tsXdRVB0yEaR&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/economy.js?v=6XKs2vVBvxm9&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/modalv2.js?v=dfMhuy-Lrpyo&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/javascript/modalContent.js?v=O5vbf725l6-I&amp;l=english"></script>
<script type="text/javascript" src="https://steamcommunity-a.akamaihd.net/public/shared/javascript/shared_responsive_adapter.js?v=qLEcRmcHn-kc&amp;l=english"></script>

            <link rel="image_src" href="https://steamcommunity-a.akamaihd.net/public/shared/images/responsive/share_steam_logo.png">

            <script type="text/javascript">
            $J(function() {
                                                    window.location='steammobile://settitle?title=' + encodeURIComponent( "Confirmations" );
                            });
        </script>
    </head>
<body class=" responsive_page">

<div class="responsive_page_frame no_header">

        <div class="responsive_local_menu_tab">

        </div>

        <div class="responsive_page_menu_ctn localmenu">
            <div class="responsive_page_menu"  id="responsive_page_local_menu">
                <div class="localmenu_content">
                </div>
            </div>
        </div>

        <div class="responsive_page_content_overlay">

        </div>

        <div class="responsive_fixonscroll_ctn nonresponsive_hidden no_menu">
        </div>

    <div class="responsive_page_content">

        <script type="text/javascript">
    g_sessionID = "888888888888888888";
    g_steamID = "88888888888888888";

    // We always want to have the timezone cookie set for PHP to use
    setTimezoneCookies();

    $J( function() {

        InitMiniprofileHovers();
        InitEmoticonHovers();
        window.BindCommunityTooltip = function( $Selector ) { $Selector.v_tooltip( {'tooltipClass': 'community_tooltip', 'dataName': 'communityTooltip' } ); };
        BindCommunityTooltip( $J('[data-community-tooltip]') );
    });

    $J( function() { InitEconomyHovers( "https:\/\/steamcommunity-a.akamaihd.net\/public\/css\/skin_1\/economy.css?v=iQbF3P_l9GzK", "https:\/\/steamcommunity-a.akamaihd.net\/public\/javascript\/economy_common.js?v=tsXdRVB0yEaR&l=english", "https:\/\/steamcommunity-a.akamaihd.net\/public\/javascript\/economy.js?v=6XKs2vVBvxm9&l=english" );});</script>
        <div class="responsive_page_template_content">

                <div id="mobileconf_list">
        <div class="mobileconf_list_entry" id="conf1080463377" data-confid="1080463377" data-key="18067422401992821592" data-cancel="Cancel" data-accept="Create Listing" >
    <div class="mobileconf_list_entry_content">
        <div class="mobileconf_list_entry_icon">
            <div style="border: 1px solid transparent;border-color: #D2D2D2;"><img src="https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrgyaZEie0NNAa-nVEDE8F5frT0eyOpLflhj3ZNxGaNNgdzYaitrr1BwQASjUU7NFXoMivcmWhwPsDAGQemA8zd0BgaaYg8TdX6TO6UywBArcUZM/32fx32f" srcset="https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrgyaZEie0NNAa-nVEDE8F5frT0eyOpLflhj3ZNxGaNNgdzYaitrr1BwQASjUU7NFXoMivcmWhwPsDAGQemA8zd0BgaaYg8TdX6TO6UywBArcUZM/32fx32f 1x, https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrgyaZEie0NNAa-nVEDE8F5frT0eyOpLflhj3ZNxGaNNgdzYaitrr1BwQASjUU7NFXoMivcmWhwPsDAGQemA8zd0BgaaYg8TdX6TO6UywBArcUZM/32fx32fdpx2x 2x"></div>        </div>
        <!--div class="mobileconf_offers_summary_chevron">
            &#x3009;
        </div-->
                    <div class="mobileconf_list_checkbox">
                <input id="multiconf_1080463377" data-confid="1080463377" data-key="18067422401992821592" value="1" type="checkbox">
            </div>
                <div class="mobileconf_list_entry_description">
            <div>Sell - The Manila Major 2016 Trophy Emoticon</div>
            <div> ¥ 115 (¥ 100)</div>
            <div>Just now</div>
        </div>
    </div>

    <div class="mobileconf_list_entry_sep"></div>
</div>
<div class="mobileconf_list_entry" id="conf1080296709" data-confid="1080296709" data-key="18144518417433075267" data-cancel="Cancel" data-accept="Create Listing" >
    <div class="mobileconf_list_entry_content">
        <div class="mobileconf_list_entry_icon">
            <div style="border: 1px solid transparent;border-color: #D2D2D2;"><img src="https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrguDIH6Z2uFCePfbDjEtCJ3-VVGvMZKM-UWgSddCNIZkb2tNi4u6gkwRUyOBV-IQAdIptMzF1w25DgSULTY5zoxSg_rJicTKG_iHB4cJ89w/32fx32f" srcset="https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrguDIH6Z2uFCePfbDjEtCJ3-VVGvMZKM-UWgSddCNIZkb2tNi4u6gkwRUyOBV-IQAdIptMzF1w25DgSULTY5zoxSg_rJicTKG_iHB4cJ89w/32fx32f 1x, https://steamcommunity-a.akamaihd.net/economy/image/W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVo47AQVZrguDIH6Z2uFCePfbDjEtCJ3-VVGvMZKM-UWgSddCNIZkb2tNi4u6gkwRUyOBV-IQAdIptMzF1w25DgSULTY5zoxSg_rJicTKG_iHB4cJ89w/32fx32fdpx2x 2x"></div>        </div>
        <!--div class="mobileconf_offers_summary_chevron">
            &#x3009;
        </div-->
                    <div class="mobileconf_list_checkbox">
                <input id="multiconf_1080296709" data-confid="1080296709" data-key="18144518417433075267" value="1" type="checkbox">
            </div>
                <div class="mobileconf_list_entry_description">
            <div>Sell - Immortal Treasure I 2016</div>
            <div> ¥ 1,150 (¥ 1,000)</div>
            <div>39 minutes ago</div>
        </div>
    </div>

    <div class="mobileconf_list_entry_sep"></div>
</div>
    </div>
    <div id="mobileconf_done" class="mobileconf_done mobileconf_header" style="display: none">
        <div>All done</div>
        <div>You're all done, there's nothing left to confirm.</div>
    </div>

<div id="mobileconf_details" style="display: none">
</div>

<div id="mobileconf_buttons" style="display: none">
    <div>
    <div class="mobileconf_button mobileconf_button_cancel">
    </div><div class="mobileconf_button mobileconf_button_accept">
    </div>
    </div>
</div>

<div id="mobileconf_throbber" style="display: none">
    <div style="text-align:center; margin: auto;">
        <img src="https://steamcommunity-a.akamaihd.net/public/images/login/throbber.gif" alt="Loading">
    </div>
</div>

        </div>  <!-- responsive_page_legacy_content -->

            <div id="footer_spacer"></div>
    <div id="footer_responsive_optin_spacer"></div>
    <div id="footer">
        <div class="footer_content">
            <span id="footerLogo"><img src="https://steamcommunity-a.akamaihd.net/public/images/skin_1/footerLogo_valve.png?v=1" width="96" height="26" border="0" alt="Valve Logo" /></span>
            <span id="footerText">
                &copy; Valve Corporation. All rights reserved. All trademarks are property of their respective owners in the US and other countries.<br/>Some geospatial data on this website is provided by <a href="https://steamcommunity.com/linkfilter/?url=http://www.geonames.org" target="_blank" rel="noreferrer">geonames.org</a>.                <br>
                                    <span class="valve_links">
                        <a href="http://store.steampowered.com/privacy_agreement/" target="_blank">Privacy Policy</a>
                        &nbsp; | &nbsp;<a href="http://www.valvesoftware.com/legal.htm" target="_blank">Legal</a>
                        &nbsp;| &nbsp;<a href="http://store.steampowered.com/subscriber_agreement/" target="_blank">Steam Subscriber Agreement</a>
                    </span>
                            </span>
        </div>
                    <div class="responsive_optin_link">
                <div class="btn_medium btnv6_grey_black" onclick="Responsive_RequestMobileView()">
                    <span>View mobile website</span>
                </div>
            </div>
            </div>

    </div>  <!-- responsive_page_content -->

</div>  <!-- responsive_page_frame -->
</body>
</html>

This is when I got totally confused. What? two data-confid and two data-key attribute again?! If the HTML code Steam is returning has always been like this, it's not possible that FetchConfirmation() can work without throwing an exception.

For reliability we'd probably be better off using a proper HTML parser like HTMLAgilityPack.

melvyn2 commented 5 years ago

BTW this issue also occurs when a phone number change request is in the confirmation queue (see this).