title: How to extract a particular link from a site if it has two links one which I want and other which I don't want?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;td&gt;
    &lt;input type="hidden" name="ctl00$ContentPlaceHolder1$dlstCollege$ctl01$hdnInstituteId" id="ContentPlaceHolder1_dlstCollege_hdnInstituteId_1" value="866  " /&gt;
    &lt;a id="ContentPlaceHolder1_dlstCollege_hlpkInstituteName_1" href="CollegeDetailedInformation.aspx?Inst=866  "&gt;A.N.A INSTITUTE OF PHARMACEUTICAL SCIENCES &amp; RESEARCH,BAREILLY (866)&lt;/a&gt;
  
    &lt;br /&gt;
    &lt;b&gt;Location:&lt;/b&gt;
    &lt;span id="ContentPlaceHolder1_dlstCollege_lblAddress_1"&gt;13.5 km Bareilly - Delhi road, near rubber factory agras road ,Bareilly&lt;/span&gt;
  
    &lt;br /&gt;
    &lt;b&gt;Course:&lt;/b&gt;
    &lt;span id="ContentPlaceHolder1_dlstCollege_lblCourse_1"&gt;B.Pharm,&lt;/span&gt;
    &lt;br /&gt;
    &lt;b&gt;Category:&lt;/b&gt;
    &lt;span id="ContentPlaceHolder1_dlstCollege_lblInstituteType_1"&gt;Private&lt;/span&gt;
    &lt;br /&gt;
    &lt;b&gt;Web Address:&lt;/b&gt;
  
    &lt;a id="lnkBtnWebURL" href='' target="_blank"&gt;&lt;/a&gt;
    &lt;br /&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;input type="hidden" name="ctl00$ContentPlaceHolder1$dlstCollege$ctl02$hdnInstituteId" id="ContentPlaceHolder1_dlstCollege_hdnInstituteId_2" value="486  " /&gt;
      &lt;a id="ContentPlaceHolder1_dlstCollege_hlpkInstituteName_2" href="CollegeDetailedInformation.aspx?Inst=486  "&gt;A.N.A.COLLEGE OF ENGINEERING &amp; MANAGEMENT,BAREILLY (486)&lt;/a&gt;
  
      &lt;br /&gt;
      &lt;b&gt;Location:&lt;/b&gt;
      &lt;span id="ContentPlaceHolder1_dlstCollege_lblAddress_2"&gt;13.5 Km. NH-24, Bareilly-Delhi Highway, Near Rubber Factory, Bareilly&lt;/span&gt;
  
      &lt;br /&gt;
      &lt;b&gt;Course:&lt;/b&gt;
      &lt;span id="ContentPlaceHolder1_dlstCollege_lblCourse_2"&gt;B.Tech,M.Tech,&lt;/span&gt;
      &lt;br /&gt;
      &lt;b&gt;Category:&lt;/b&gt;
      &lt;span id="ContentPlaceHolder1_dlstCollege_lblInstituteType_2"&gt;Private&lt;/span&gt;
      &lt;br /&gt;
      &lt;b&gt;Web Address:&lt;/b&gt;
  
      &lt;a id="lnkBtnWebURL" href='http://www.anacollege.org/index.html' target="_blank"&gt;http://www.anacollege.org/index.html&lt;/a&gt;
      &lt;br /&gt;
    &lt;/td&gt;
  &lt;/tr&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to extract a particular URL(for eg: CollegeDetailedInformation.aspx?Inst=866) from this website but this code has two  tags one of which I don't want(for eg:<a href="http://www.anacollege.org/index.html" rel="nofollow noreferrer">http://www.anacollege.org/index.html</a>).</p>
  
  <pre><code>
  res = requests.get('https://erp.aktu.ac.in/WebPages/KYC/CollegeList.aspx?City=&amp;CType=&amp;Cu=&amp;Br=&amp;Inst=&amp;IType=')
  soup = BeautifulSoup(res.content, 'html.parser')
  
  
  table = soup.find("table", attrs = {'class':'table table-bordered table-responsive'})
  
  pagelink = []
  for anchor in table.findAll('a')[1:]:
          link = anchor['href']
          print(link)
          url = 'https://erp.aktu.ac.in/WebPages/KYC/'+ link
          pagelink.append(url)
  print(pagelinks)
  </code></pre>
  
  <p>I wrote this code but it is extracting all the links</p>
  
  <pre><code>CollegeDetailedInformation.aspx?Inst=486  
  http://www.anacollege.org/index.html
  CollegeDetailedInformation.aspx?Inst=602  
  http://www.aashlarbschool.com
  CollegeDetailedInformation.aspx?Inst=032  
  http://www.abes.ac.in
  CollegeDetailedInformation.aspx?Inst=290  
  http://www.abesit.in
  CollegeDetailedInformation.aspx?Inst=913  
  http://www.abesitpharmacy.in
  CollegeDetailedInformation.aspx?Inst=643  
  http://www.vitsald.com
  CollegeDetailedInformation.aspx?Inst=1036 
  http://www.abss.edu.in
  </code></pre>
  
  <p>how do I solve this I only want the link with the CollegeDetailedInformation.aspx?Inst=? part.</p>