I was trying to scrape all the tables in the following link of Wikipedia in general to get the episode number and name. But it stops near the first table and doesn't move around with the second one. I need some light on it.
wiki_link : https://en.wikipedia.org/wiki/One_Piece_(season_20)#Episode_list
But the given data in table looks like this :

Basically I am trying to fetch the data in the rows with respect to the columns [ No.Overall [n1] & Title[n2] ]
[i.e 892 The Land of Wano! To the Samurai Country where Cherry Blossoms Flutter! ]
*Required output in CSV like:
the code:
from bs4 import BeautifulSoup
from pandas.plotting import table
import requests
url = "https://en.wikipedia.org/wiki/One_Piece_(season_20)#Episode_list"
response = requests.get(url)
soup = BeautifulSoup(response.text,'lxml')
table = soup.find('table',{'class':'wikitable plainrowheaders wikiepisodetable'}).tbody
rows = table.find_all('tr')
columns = [v.text.replace('\n','') for v in rows[0].find_all('th')]
#print(len(rows))
#print(table)
df = pd.DataFrame(columns=columns)
print(df)
for i in range(1,len(rows)):
tds = rows[i].find_all('td')
print(len(tds))
if len(tds)==6:
values1 = [tds[0].text, tds[1].text, tds[2].text, tds[3].text.replace('\n',''.replace('\xa0',''))]
epi = values1[0]
title = values1[1].split('Transcription:')
titles = title[0]
print(f'{epi}|{titles}')
else:
values2 = [td.text.replace('\n',''.replace('\xa0','')) for td in tds]
