title: scrape multiple clubs per player in one cell of the java script table - display both in the same list element
body: <p>My problem is, that in the last cell of the javascript table, I get the clubs the player played for via the &quot;img&quot;.</p>
  <pre><code>injury_list = []
  season_list = []
  day_list = []
  missedgame_list = []
  team_list = [] 
  player_list = []
  </code></pre>
  <pre><code> url = 'https://www.transfermarkt.ch/emre-can/verletzungen/spieler/119296/ajax/yw1/page1'
      response = requests.get(url, headers={'User-Agent': 'Custom5'})
      injury_data = response.text
      soup = BeautifulSoup(injury_data, 'html.parser')
      table = soup.find(id=&quot;yw1&quot;)
      
      injurytypes = table.select(&quot;td[class='hauptlink bg_rot_20']&quot;) + table.select(&quot;td[class='hauptlink']&quot;)
      all_injuries = [injury.text for injury in injurytypes]
      injury_list.extend(all_injuries)
    
      
      seasons =  table.select(&quot;td[class='zentriert bg_rot_20']&quot;) + table.select(&quot;td[class='zentriert']&quot;)
      all_seasons = [season.text for season in seasons]
      season_list.extend(all_seasons)
          
      days = table.select(&quot;td[class='rechts bg_rot_20']&quot;) + table.select(&quot;td[class='rechts']&quot;)
      all_days =[float(day.text.split()[0]) for day in days]
      day_list.extend(all_days)
          
      missedgames = table.select(&quot;td[class='rechts hauptlink wappen_verletzung bg_rot_20']&quot;) + table.select(&quot;td[class='rechts hauptlink wappen_verletzung']&quot;)
      all_missedgames = [float(missedgame.text.replace(&quot;-&quot;, &quot;0&quot;)) for missedgame in missedgames]
      missedgame_list.extend(all_missedgames)
      
      for item in table.select('img', class_='tiny_wappen', recursive=True): 
              team_list.append(item.get('alt'))
  </code></pre>
  <p>i need a dataframe with the different cell entries and that when there are two clubs, I have both clubs in the same dataframe cell Juventus Turin / Borussia Dortmund.
  Otherwise I have a problem, that the code returns lists from different lenght, respectively not everything fits togehter in a dataframe.</p>
  <p>I already tried it with if loops to indicate that if there are two img in one cell etc. but did not succeed.</p>
  <p>Thank you very much.</p>
  <pre><code>season_list_def = season_list[0::3]
  startdate_list = season_list[1::3]
  enddate_list = season_list[2::3]
  </code></pre>
  <pre><code>df = pd.DataFrame({&quot;injurytype&quot;: injury_list, &quot;season&quot;: season_list_def, &quot;injury_start&quot;: startdate_list, &quot;injury_end&quot;: enddate_list, &quot;absence_duration&quot;: day_list, &quot;missed_games&quot;: missedgame_list, &quot;Team&quot;: np.nan})
  df.loc[df[&quot;missed_games&quot;] != 0, &quot;Team&quot;] = team_list #this is not working because the lenght of team list is not from equal size because I have two clubs in one cell. 
  df
  </code></pre>