Extract from windows HTML without ID but Class name RRS feed

  • Question

  • Hello great programmers,

    Please i am having a serious problem. i am building a software as a part of project given to me to be completed in some weeks coming now but it is not as it seems to be with ID.

     i can't simply extract with classNAme. it is not just working.

    What i am trying to do is extract Numbers of games in a particular site with their corresponding selection but it is hard with ust the className please help me out.

    See picture of what i am trying to do in the code.

    This is the corresponding code. Please can you extract it without ID using VB and How? please


    <div class="CItems">
                                    <div class="CItem te1 ">
                                        <div class="CInfo" title="Bundesliga"></div>
                                        <div class="CCodPub">
                                        <div class="CEvento">Bundesliga</div>
                                        <div id="ctl00_w_ContentMain_ContentMain_Coupon1_repCoupon_ctl01_SubEventLink" class="CSubEv"><span id="ctl00_w_ContentMain_ContentMain_Coupon1_repCoupon_ctl01_SE" title="Mainz - Bayer Leverkusen">Mainz - Bayer Leverkusen</span></div>
                                                <div class="COdds False ">
                                                    <a id="ctl00_w_ContentMain_ContentMain_Coupon1_repCoupon_ctl01_repCouponDetails_ctl00_LinkButton1" title="Remove from the betslip" class="CDelete" href="javascript:__doPostBack('ctl00$w$ContentMain$ContentMain$Coupon1$repCoupon$ctl01$repCouponDetails$ctl00$LinkButton1','')"></a>                                                                                                                                                

                                                    <div class="CSegno">
                                                        <span class="ClblSegno"> </span>3-5 Goals                                                                                         
                                                        <div class="valQuota_1">1.82</div>                                                

                                                    <div class="DIQ" id="DIQ_3414501242">3-5 Goals|1.82|S|0</div>

                                    <div class="CItem te1 ">
                                        <div class="CInfo" title="Championship"></div>
                                        <div class="CCodPub">
                                        <div class="CEvento">Championship</div>
                                        <div id="ctl00_w_ContentMain_ContentMain_Coupon1_repCoupon_ctl02_SubEventLink" class="CSubEv"><span id="ctl00_w_ContentMain_ContentMain_Coupon1_repCoupon_ctl02_SE" title="Aston Villa - Sheffield Utd">Aston Villa - Sheffield Utd</span></div>
                                                <div class="COdds False ">
                                                    <a id="ctl00_w_ContentMain_ContentMain_Coupon1_repCoupon_ctl02_repCouponDetails_ctl00_LinkButton1" title="Remove from the betslip" class="CDelete" href="javascript:__doPostBack('ctl00$w$ContentMain$ContentMain$Coupon1$repCoupon$ctl02$repCouponDetails$ctl00$LinkButton1','')"></a>                                                                                                                                                

                                                    <div class="CSegno">
                                                        <span class="ClblSegno"> </span>XorGG                                                                                         
                                                        <div class="valQuota_1">1.50</div>                                                

                                                    <div class="DIQ" id="DIQ_3413337052">XorGG|1.50|S|0</div>


    I want to extract code this way:

    1270| 3-5 goals

    1040| XorGG

    2717| over 2.5

    • Edited by Switjoe2019 Friday, February 8, 2019 6:06 PM clarifiation
    Friday, February 8, 2019 6:02 PM

All replies

  • Hello,

    There is an shortcuts here, best to get Html Agility Pack. Used code like shown in the following page, look at the parent and child spans and get values.

    Be forewarned the majority of samples will be in C#

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, February 8, 2019 7:48 PM