How to extract the specified ID? from Baidu result list page by beatifulsoup

below, the div under HTML, of Baidu search results page contains a result.

I want to query the ranking position of a given URL in the results list. After analysis, it is found that in the first row div id= "3001" , one of 3001 is the ranking position, and 1 means the first place.

now that the url:www.jjl.cn is given, how can you use beatifulsoup to extract the id number after the div where the www.jjl.cn is located?

<div id="3001" class="cYdIPG Iq_PaK HMfXhq QchRxN" data-click="{"fm":"pp", "p1":3001, "p5":3001, "rsv_srcid":"49509"}">
   <div class="lDrvXu">
    <h3 class="t xEvHul PGebWq"><a href="http://www.baidu.com/baidu.php?url=K600000-SwTdAzCGTXH4rMf-Jg86BDH9gBOtXktq47uhVuUhVG3EzH3B6Wyd8jiP5J2fgsvQYNyMJmitH9zps5Q4_d-WfHfXbiDXQ-eUjv-Lw7KD-jSNd-DTDXhSDJffx8w2cfWMtOVNY3ne6U_KUZBc8p1GjQ4mwmKflJE3Z_NdHpqx1s.DD_jQ-CtMXZHWknXELSyXqM761s33TSr8z1l4O-zvNt8a5-_oSEQW94TII-Md4U2OozdeQPSx4T8JU-ovyUltMQwlQQ2OoMSyxOOLODiOqH0eqUtZO0sFOOqutlhGv-5QWdQjPakkLIMWkR.U1Yk0ZDq_Op4S_ZYYpT0TA-W5HD0IjLjsQMlsxHwGsKGUHYznWR0u1dBugK1nfKdpHdBmy-bIfKspyfqnfKWpyfqn16d0AdY5HDsnH-xnH0kPdtznjmzg1fsPWKxn1msnfKopHYs0ZFY5HnsPfK-pyfqnHfzP7tznHDkPdtzP1fsnNtznjbzr0KBpHYznjwxnHRd0AdW5HDsnj7xP164PjRsP1mLg1DdnjTLn1T4PWKxn10snWRsnWnLn7ts0Z7spyfqn0Kkmv-b5H00ThIYmyTqn0K9mWYsg100ugFM5H00TZ0qnWbLPjcYnWc40A4vTjYsQW0snj0snj0s0AdYTjYs0AwbUL0qn0KzpWYs0Aw-IWdsmsKhIjYs0ZKC5H00ULnqn0KBI1Yv0A4Y5H00TLCq0ZwdT1YvPHT4rHDYnjmvrj6knHDLnHbv0ZF-TgfqnHRYnjndP1nzP10zrfK1pyfqmyfvP1mdujfsnj0kmyDdr0KWTvYqPHKarHm4wbD1n1bvPWD1P0K9m1Yk0ZK85H00TydY5H00Tyd15H00XMfqn0KVmdqhThqV5HKxn7tsg1Kxn0Kbmy4dmhNxTAk9Uh-bT1Ysg1Kxn7tsg100TA7Ygvu_myTqn0Kbmv-b5H00ugwGujYVnfK9TLKWm1Ys0ZNspy4Wm1Ys0Z7VuWYs0AuWIgfqn0KhXh6qn0Khmgfqn0KlTAkdT1Ys0A7buhk9u1Yk0Akhm1Ys0APzm1YkP1fLnf" class="JWKZVO" data-is-main-url="true" data-landurl="http://www.jjl.cn?cmpid=BID-baidu-cpc-p100F-D_01_us_01F_pc_p100F_01F_1809-D_gr_180912_lx001F-D-[MeiGuoLiuXue]--" target="_blank"><font color="-sharpCC0000"></font>--<font color="-sharpCC0000"></font>19</a>
    </h3>
   </div>
   <div class="c-abstract PtmqVw kZLQA_ "> 
    <div class="c-row c-gap-top-small  c-gap-bottom-small ec-img"> 
     <div class="general_image_pic c-span6">
      <a target="_blank" href="http://www.baidu.com/baidu.php?url=K600000-SwTdAzCGTXH4rMf-Jg86BDH9gBOtXktq47uhVuUhVG3EzH3B6Wyd8jiP5J2fgsvQYNyMJmitH9zps5Q4_d-WfHfXbiDXQ-eUjv-Lw7KD-jSNd-DTDXhSDJffx8w2cfWMtOVNY3ne6U_KUZBc8p1GjQ4mwmKflJE3Z_NdHpqx1s.DD_jQ-CtMXZHWknXELSyXqM761s33TSr8z1l4O-zvNt8a5-_oSEQW94TII-Md4U2OozdeQPSx4T8JU-ovyUltMQwlQQ2OoMSyxOOLODiOqH0eqUtZO0sFOOqutlhGv-5QWdQjPakkLIMWkR.U1Yk0ZDq_Op4S_ZYYpT0TA-W5HD0IjLjsQMlsxHwGsKGUHYznWR0u1dBugK1nfKdpHdBmy-bIfKspyfqnfKWpyfqn16d0AdY5HDsnH-xnH0kPdtznjmzg1fsPWKxn1msnfKopHYs0ZFY5HnsPfK-pyfqnHfzP7tznHDkPdtzP1fsnNtznjbzr0KBpHYznjwxnHRd0AdW5HDsnj7xP164PjRsP1mLg1DdnjTLn1T4PWKxn10snWRsnWnLn7ts0Z7spyfqn0Kkmv-b5H00ThIYmyTqn0K9mWYsg100ugFM5H00TZ0qnWbLPjcYnWc40A4vTjYsQW0snj0snj0s0AdYTjYs0AwbUL0qn0KzpWYs0Aw-IWdsmsKhIjYs0ZKC5H00ULnqn0KBI1Yv0A4Y5H00TLCq0ZwdT1YvPHT4rHDYnjmvrj6knHDLnHbv0ZF-TgfqnHRYnjndP1nzP10zrfK1pyfqmyfvP1mdujfsnj0kmyDdr0KWTvYqPHKarHm4wbD1n1bvPWD1P0K9m1Yk0ZK85H00TydY5H00Tyd15H00XMfqn0KVmdqhThqV5HKxn7tsg1Kxn0Kbmy4dmhNxTAk9Uh-bT1Ysg1Kxn7tsg100TA7Ygvu_myTqn0Kbmv-b5H00ugwGujYVnfK9TLKWm1Ys0ZNspy4Wm1Ys0Z7VuWYs0AuWIgfqn0KhXh6qn0Khmgfqn0KlTAkdT1Ys0A7buhk9u1Yk0Akhm1Ys0APzm1YkP1fLnf&us=0.0.0.0.0.0.0.101" class="_vLdCl c-img6"><img class="c-img c-img6" src="https://ss3.baidu.com/-rVXeDTa2gU2pMbgoY3K/it/u=2419322873,4046673367&fm=202&src=766&mola=new&crop=v1" /></a>
     </div> 
     <div class="c-span18 c-span-last">
      <div class="">
       
       <font color="-sharpCC0000"></font> .,
       <font color="-sharpCC0000"></font>,
       <font color="-sharpCC0000"></font>19,11
       <font color="-sharpCC0000"></font>,,
       <font color="-sharpCC0000"></font>!
       <font size="-1" style="margin-left:10px;"></font>
      </div>
     </div>
    </div>
    <div class="vUwVWB">
     <div class="txAvnR ">
      <span class="OKRufv"></span>
     </div>
     <form class="vYiauI fvsqKh" data-mt="3002502370" data-cm="225" data-sid="ad6765d40001aa58" data-wi="97661210102" data-ui="7377968" data-pd="92794089" data-ud="3489304352" data-qd="" data-pid="1" data-cid="385" data-bid="202B7EAD918F2AD57A2A563398DE2E55" data-cuid="" data-pud="297424229">
      <div class="c-row c-gap-top-small c-gap-bottom-small">
       <div class="c-span9 clearfix">
        <label for="uQOTdx" class="QEMAts">:</label>
        <div class="UIAOam">
         <div class="c-dropdown2 uqahIi">
          <div class="c-dropdown2-btn-group">
           <div class="c-dropdown2-btn balwLd aWzInR vn_XmB" data-type="select">
            
           </div>
           <div class="c-dropdown2-btn-icon vn_XmB">
            <div class="c-dropdown2-btn-icon-border">
             <i class="c-icon c-icon-triangle-down"></i>
            </div>
           </div>
          </div>
          <div class="c-dropdown2-menu eZxfWl">
           <div class="c-dropdown2-menu-inner">
            <ul class="c-dropdown2-menubox uQOTdx">
             <li class="c-dropdown2-option WvrdpP YmUaWI" data-value=""></li>
             <li class="c-dropdown2-option WvrdpP YmUaWI" data-value=""></li>
             <li class="c-dropdown2-option WvrdpP YmUaWI" data-value=""></li>
             <li class="c-dropdown2-option WvrdpP YmUaWI" data-value=""></li>
            </ul>
           </div>
          </div>
         </div>
        </div>
       </div>
       <div class="c-span9 KHMOo_ clearfix">
        <label class="QEMAts" for="">:</label>
        <div class="UIAOam">
         <input type="text" name="" class="c-input zpWktP balwLd" placeholder="" data-reg="^1(3|4|5|7|8)\d{9}$" required="required" data-min="" data-max="" data-type="contact" data-ctype="phone" />
        </div>
       </div>
       <div class="c-span6 c-span-last">
        <a class="WBzdGu" href="javascript:void(0);" target="_blank" data-cklink="http://www.baidu.com/baidu.php?url=K600000xEIPnyEqCGlv8l1-oAmKpDhu26phiXQIm4fD5bD6UU-FxC7NPrsu02eGd1LNUQpH0jaiwluufNwv3fkHkh1UcOsQSumXQm8VzY-g_43McPEf3cL-_1rskWyMp54PrHcVS1kqZENH7evmIaIb26TflAIgO94-1i3DVWiVCsr8kU6.DD_jQ-CtMXZHWknXELSyXqM761s33TSr8z1l4O-zvNt8a5-_oSEQW94TII-Md4U2OozdeQPSx4T8JU-ovyUltMQwlQQ2OoMSyxOOLODiOqH0eqUtZO0sFOOqutlhGv-5QWdQjPakkLIMWkR.U1Yk0ZDq_Op4S_ZYYpT0TA-W5HD0IjLjsQMlsxHwGsKGUHYznWR0u1dBugK1nfKdpHdBmy-bIfKspyfqnfKWpyfqn16d0AdY5HfsPWKxnH0krNtknjDLg1csPWFxn1msnfKopHYk0ZFY5HnsPfK-pyfqnHfzP7tznHDkPdtzP1fsnNtznjbzr0KBpHYznjwxnHRd0AdW5Hnsnjcdnjc1P1KxnH0snNtLrjbYPH0LPWIxnHRsP1T1P1bvn7ts0Z7spyfqn0Kkmv-b5H00ThIYmyTqn0K9mWYsg100ugFM5H00TZ0qnWbLPjcYnWc40A4vTjYsQW0snj0snj0s0AdYTjYs0AwbUL0qn0KzpWYs0Aw-IWdsmsKhIjYs0ZKC5H00ULnqn0KBI1Yv0A4Y5H00TLCq0ZwdT1YvPHT4rHDYnjmvrj6knHDLnHbv0ZF-TgfqnHRYnjndP1nzP10zrfK1pyfqmyfvP1mdujfsnj0kmyDdr0KWTvYqPHKarHm4wbD1n1bvPWD1P0K9m1Yk0ZK85H00TydY5H00Tyd15H00XMfqn0KVmdqhThqV5HKxn7tsg1Kxn0Kbmy4dmhNxTAk9Uh-bT1Ysg1Kxn7tsg100TA7Ygvu_myTqn0Kbmv-b5H00ugwGujYVnfK9TLKWm1Ys0ZNspy4Wm1Ys0Z7VuWYs0AuWIgfqn0KhXh6qn0Khmgfqn0KlTAkdT1Ys0A7buhk9u1Yk0Akhm1Ys0APzm1YdP1czns"><button class="c-btn c-btn-primary"></button></a>
       </div>
      </div>
     </form>
     <div class="SPAetj">
      <div class="lLcUsP" data-info=""></div>
      <div class="qYLulp">
       <a target="_blank" href="http://www.jjl.cn?cmpid=BID-baidu-cpc-p100F-xiansuotong-ceshi">>></a>
      </div>
     </div>
    </div>
   </div>
   <div class="ALmhwn kZLQA_">
    <a href="http://www.baidu.com/baidu.php?url=K600000-SwTdAzCGTXH4rMf-Jg86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="_blank" class="ZieAvF"><span class="nGOLtZ">www.jjl.cn</span><span class="JERLyu">2018-10</span></a>
    <div id="tools_" style="margin-left:5px;" class="c-tools">
     <a class="c-tip-icon"><i class="c-icon c-icon-triangle-down-g"></i></a>
    </div>
    <span class="icons PGebWq HFLnrN"><a href="https://www.baidu.com/s?wd=%E9%87%91%E5%90%89%E5%88%97%E5%87%BA%E5%9B%BD%E7%95%99%E5%AD%A6%E5%92%A8%E8%AF%A2%E6%9C%8D%E5%8A%A1%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8@v&vmp_ec=1538610151&vmp_ectm=efef1d659172c37aa43efN5bc=N6m7NldX4e6365g5jzzz7cc86kc7l0X48615a06adf9da9&from=fc&dataTime=56&rsv_dl=0_left_v_3" target="_blank" class="WFRyGi c-icon  icon-certify c-icon-v c-icon-v3" data-fclick="{"rsv_mt":"1017","rsv_vlevel":"3"}" data-renzheng="{"title":"\u91d1\u5409\u5217\u51fa\u56fd\u7559\u5b66\u54a8\u8be2\u670d\u52a1\u6709\u9650\u516c\u53f8","identity":{"a":{"fm":"pp","rsv_mt":1017,"rsv_vlevel":"3","rsv_vmenu":1,"p1":3001,"url":"https:\/\/www.baidu.com\/s?wd=%E9%87%91%E5%90%89%E5%88%97%E5%87%BA%E5%9B%BD%E7%95%99%E5%AD%A6%E5%92%A8%E8%AF%A2%E6%9C%8D%E5%8A%A1%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8@v&vmp_ec=1538610151&vmp_ectm=efef1d659172c37aa43efN5bc=N6m7NldX4e6365g5jzzz7cc86kc7l0X48615a06adf9da9&from=fc&dataTime=56&rsv_dl=0_left_v_3"},"img":"","text":"","credit":"5","process":"124","process_level":"3","unfixedInfo":{"rzItems":[],"bzItems":[]},"webIMUrl":"","type":""}}"></a></span>
    <font class="gqRMzj TqLCFY S_hMcmppouter " size="-1">-<a href="https://koubei.baidu.com/s/1f1beddd3995268f0fae75743c7f584b?src=fc&title=%E7%BE%8E%E5%9B%BD%E7%95%99%E5%AD%A6-%E9%87%91%E5%90%89%E5%88%97%E7%95%99%E5%AD%A6%E6%9C%BA%E6%9E%84-%E4%B8%93%E6%B3%A8%E7%95%99%E5%AD%A619%E5%B9%B4&q=%E5%87%BA%E5%9B%BD%E7%95%99%E5%AD%A6&from=fc_pc1" target="_blank" class="m iPybaf"></a></font>
    <font class="gqRMzj ec_tuiguang_ppouter ec_tuiguang_container" size="-1">-<a class="PGebWq m TVfUxm m ec_tuiguang_ppouter ec_tuiguang_pplink" target="_blank" href="http://e.baidu.com/?id=1" style=""><span data-tuiguang="{"tuiguang_text":"\u672c\u641c\u7d22\u7ed3\u679c\u4e3a<a href=\"http:\/\/e.baidu.com\/?id=1\" target=\"_blank\">\u5546\u4e1a\u63a8\u5e7f<\/a>\u4fe1\u606f\uff0c\u8bf7\u6ce8\u610f\u53ef\u80fd\u7684\u98ce\u9669\u3002<br\/>\u60a8\u5f53\u524d\u4e3a\u767b\u5f55\u72b6\u6001\uff0c\u5df2\u53c2\u52a0<a href=\"http:\/\/baozhang.baidu.com\/guarantee\/\" target=\"_blank\">\u7f51\u6c11\u6743\u76ca\u4fdd\u969c\u8ba1\u5212<\/a>\u3002","tuiguang_title":""}" class="LWuJsy"></span></a></font>
   </div>
   <a href="javascript:void(0);" target="_blank" class=" zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;" data-rank="0"></a>
   <a href="javascript:void(0);" target="_blank" class="c-gap-left-large zpehtD" style="display: none;border:none;" data-rank="0"></a>
  </div>
Sep.16,2021

is only valid for the HTML file you posted:

soup.select('div.cYdIPG')[0]['id']
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dc1b-2c3b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dc1b-2c3b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?