there are multiple issues with the code you posted, to the extent it will never run, nor produce any erroro
import requests from bs4 import BeautifulSoup url = "https://en.wikipedia.org/wiki/%C3%B7_(album)" response = requests.get(url, timeout = 10) soup = BeautifulSoup(response.text, 'html.parser') right_table = soup.find('table', {'class': 'wikitable floatright'}) header = [th.text.rstrip() for th in right_table.find_all('th')] print(header) print('------') print(len(header))
Output:['Aggregate scores', 'Source', 'Rating', 'Review scores', 'Source', 'Rating']
------
6
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs