hi i am new in web scraping this code works perfectly but it is printing on the last row into the csv file.I don't know why I printed values also on console and its printing all the rows
import bs4 as bs
import urllib
import pandas as pd
dfs = pd.read_html('http://www.espn.com/mlb/team/roster/_/name/nyy/new-york-yankees/' ,header= 0)
for df in dfs:
df.to_csv('losangeles.csv', sep='\t',encoding='utf-8')