1

I have the following soup

 </title>
  <meta content="Erfahre aus erster Hand, ob xxx als Arbeitgeber zu dir passt. 21 Erfahrungsberichte von Mitarbeitern liefern dir die Antwort." name="description"/>
  <link href="https://www.kununu.com/de/xxx/kommentare/3" rel="next"/>
  <link href="https://www.kununu.com/de/xxx/kommentare" rel="prev"/>
  <link href="https://www.kununu.com/de/xxx/kommentare/2" rel="canonical"/>
  <script type="application/ld+json">

I would like to select the URL with the attribute "next"

<link href="https://www.kununu.com/de/xxx/kommentare/3" rel="next"/>

How do I do that?

XabX
  • 23
  • 2
  • 1
    Your question was answered here https://stackoverflow.com/questions/1080411/retrieve-links-from-web-page-using-python-and-beautifulsoup – Syed Adnan Haider Nov 07 '20 at 19:31

1 Answers1

0
soup = BeautifulSoup(html)
results = soup.findAll("link", {"rel" : "next"})

for result in results:
   if result.has_attr('href'):
      print(link['href'])
Syed Adnan Haider
  • 74
  • 1
  • 2
  • 11