title: List links in web page with python
body: <p>I am trying to write a python script that lists all the links in a webpage that contain some substring. The problem that I am running into is that the webpage has multiple "pages" so that it doesn't clutter all the screen. Take a look at <a href="https://www.go-hero.net/jam/17/solutions/1/1/C++" rel="nofollow noreferrer">https://www.go-hero.net/jam/17/solutions/1/1/C++</a> for an example. </p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  url = "https://www.go-hero.net/jam/17/solutions/1/1/C++"
  response = requests.get(url)
  soup = BeautifulSoup(response.content, "html5lib")
  links = soup.find_all('a')
  
  for tag in links:
    link = tag.get('href', None)
    if link is not None and 'GetSource' in link:
      print(link)
  </code></pre>
  
  <p>Any suggestions on how I might get this to work? Thanks in advance.</p>