original_docstring: 
      Function to scrape Vote Smart by "Education" <b> element
      
docstring: Function to scrape Vote Smart by "Education"  element
docstring_tokens: Function to scrape Vote Smart by " Education " element
code: def vs_edu_scrape(rep):
      '''
      Function to scrape Vote Smart by "Education" <b> element
      '''
      
      url = 'https://justfacts.votesmart.org/candidate/biography/' + rep['votesmart_id']
      r = requests.get(url).content
      soup = BeautifulSoup(r)
  
      # Collapsable card object
      edu_card = soup.find('b', text='Education').parent.parent.parent
      
      # Education paragraph objects
      edu = [ p.text for p in edu_card.find_all('p') ]
      
      edus = []
      for e in edu:
          entry = e.split(',')
          if len(entry[0]) < 5:
              degree = entry[0]
              for s in entry[1:]:
                  pattern = '(?=.*College)|(?=.*University)|(?=.*School)|(?=.*Institute)'
                  if re.search(pattern, s):
                      institution = s.strip()
                      edus.append([degree, institution])
      
      if edus != []:
          return edus
      else:
          return None
code_tokens: def vs_edu_scrape ( rep ) : url = 'https://justfacts.votesmart.org/candidate/biography/' + rep [ 'votesmart_id' ] r = requests . get ( url ) . content soup = BeautifulSoup ( r ) edu_card = soup . find ( 'b' , text = 'Education' ) . parent . parent . parent edu = [ p . text for p in edu_card . find_all ( 'p' ) ] edus = [ ] for e in edu : entry = e . split ( ',' ) if len ( entry [ 0 ] ) < 5 : degree = entry [ 0 ] for s in entry [ 1 : ] : pattern = '(?=.*College)|(?=.*University)|(?=.*School)|(?=.*Institute)' if re . search ( pattern , s ) : institution = s . strip ( ) edus . append ( [ degree , institution ] ) if edus != [ ] : return edus else : return None
short_docstring: Function to scrape Vote Smart by "Education" <b> element
short_docstring_tokens: Function to scrape Vote Smart by " Education " <b > element
comment: '''
      Function to scrape Vote Smart by "Education" <b> element
      '''$SEP$# Collapsable card object$SEP$# Education paragraph objects