title: How to make a loop to extract text from hyperlinks in a webpage
body: <p>I'm still quite new to python and trying to use it for webscraping.</p>
  
  <p>Specifically, I want to get all the quotes on <a href="http://archive.ontheissues.org/Free_Trade.htm" rel="nofollow noreferrer">this page</a>, that are given here: "XXX full quotes by YYY" or in the case there's only one quote: "the full quote by YYY". After getting the text on each page, I want to have them saved as a separate text file. </p>
  
  <p>I've been following this <a href="https://www.youtube.com/watch?v=XQgXKtPSzUI&amp;t=567s" rel="nofollow noreferrer">tutorial</a>, but I'm a little confused in terms of how to filter the html? Honestly, I have barely any experience with HTML so it's a little hard to navigate what it means, but I THINK, the section of interest is this:</p>
  
  <pre><code> &lt;a href="javascript:pop('../2020/
  </code></pre>
  
  <p>Here's my code so far, to open the webpage. </p>
  
  <pre><code>import bs4
  from urllib.request import Request,urlopen as uReq
  from bs4 import BeautifulSoup as soup
  
  import re
  #define url of interest
  my_url = 'http://archive.ontheissues.org/Free_Trade.htm'
  
  # set up known browser user agent for the request to bypass HTMLError
  req=Request(my_url,headers={'User-Agent': 'Mozilla/5.0'})
  
  #opening up connection, grabbing the page
  uClient = uReq(req)
  page_html = uClient.read()
  uClient.close()
  
  #html is jumbled at the moment, so call html using soup function
  
  soup = soup(page_html, "html.parser")
  </code></pre>
  
  <p>Any help is very appreciated.</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>My idea is that, I'll compile the relevant URLs first and store them, then try and get bs to store the text in each URL. 
  I have managed to isolate all the links of interest:</p>
  
  <pre><code>tags = soup.findAll("a" , href=re.compile("javascript:pop"))
  print(tags)
  
  for links in tags:
      link = links.get('href')
      if "java" in link: 
          print("http://archive.ontheissues.org" + link[18:len(link)-3])
  </code></pre>
  
  <p>Now, how can I extract the text from each of the individual links?</p>