title: BeautifulSoup - Use find_all() to find specific strings inside HTML
body: <p>Here is the current code that I have:</p>
  
  <pre><code>from bs4 import BeautifulSoup
  
  import requests
  
  header = {'User-agent' : 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5'}
  
  url  = requests.get("https://d1baseball.com/scores/?date=20170407&amp;c=PKzxg", headers = header).text
  
  soup = BeautifulSoup(url, 'html.parser')
  
  boxscores = soup.find_all('a', text = 'Box Score')
  
  for eachboxscore in boxscores:
      links = eachboxscore.get('href')
      print(links)
      url = requests.get(links, headers = header).text
      soup = BeautifulSoup(url, 'html.parser')
      pbp = soup.find_all('a', text = {'Play-By-Play' or 'Play by Play' or 'Play By Play' or 'Play-by-Play'})
      print(pbp)
      for eachpbp in pbp:
          button = eachpbp.get('href')
          print(button)
  </code></pre>
  
  <p>I am not sure if I am implementing the logical operator 'or' correctly here or not. I want to be able to search 'a' tags in the html (for all the url's in the for loop - in this case there are 6 different links) and find the location of the Play-By-Play string to locate the respective link to the Play-By-Play data (note that sometimes the link to the Play-By-Play data is simply another url, whereas other times it may just redirect to another location on the same webpage such as: #play-by-play).</p>
  
  <p>A quick follow-up question would then be, how to "click" this redirect link? Or would it be easier to append this to the end of the url that I am already located at?</p>
  
  <p>Thanks for any help in advance!</p>