response2 = session.post(url, headers = header)
soup = BeautifulSoup(response2.text, 'html.parser')
def get_entry():
for i in range(0,8):
table = soup.findAll("table",{"class":"new_table"})[i]
rows = table.findAll("tr")
writer = csv.writer(e3)
for row in rows:
csvRow = []
for cell in row.findAll(['td', 'tr']):
csvRow.append(cell.get_text())
# 写入
writer.writerow(csvRow)
python报错:IndexError: list index out of range
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-