我正在尝试从网页抓取数据。.使用beautifulsoup和请求..但我收到错误列表索引超出范围..如何解决此错误..任何帮助将不胜感激..在此先感谢..
from bs4 import BeautifulSoup
import requests
import time
url = 'https://etrain.info/in?PNR=6429866568'
response = requests.get(url)
time.sleep(1)
soup = BeautifulSoup(response.content, "html.parser")
Table = soup.find_all('table', class_='nocps fullw bx2s rnd5')
Table = Table[0]
for row in Table.find_all('tr'):
for cell in row.find_all('td'):
print(cell.text)