Python 2.7 Python中的Beautifulsoup不完整表解析

Python 2.7 Python中的Beautifulsoup不完整表解析,python-2.7,xml-parsing,beautifulsoup,Python 2.7,Xml Parsing,Beautifulsoup,我正在尝试使用Beautifulsoup和python2.7创建一个web表 请求正常,但解析不完整。 不管桌子的实际长度是多少,它似乎都会停在1668个单元格左右 代码如下: import os, time, string, operator, requests from bs4 import BeautifulSoup url='http://fse.vdkruijssen.eu/ferrylist.php' params ={'selectplane':'Cessna 208 Cara

我正在尝试使用Beautifulsoup和python2.7创建一个web表

请求正常,但解析不完整。 不管桌子的实际长度是多少,它似乎都会停在1668个单元格左右

代码如下:

import os, time, string, operator, requests
from bs4 import BeautifulSoup

url='http://fse.vdkruijssen.eu/ferrylist.php'

params ={'selectplane':'Cessna 208 Caravan','submit':''}
response=requests.post(url, data=params)

soup = BeautifulSoup(response.text, "lxml")
table = soup.find(id="ferryplane")
for tr in table.find_all('tr', class_=True):  # filter the row that without text
    row = [cell.text for cell in tr.find_all('td')]
    print(row)
如何检索所有单元格

我对网页抓取很陌生,如果有任何帮助,我将不胜感激

谢谢大家!

编辑:显然代码没有问题。我仍然得到截短的响应,如图所示(最后一行)。如果你知道这是什么原因,请告诉我

输出:

我确信没有行丢失:

输出:

我确信没有行丢失:

谢谢您的回答,但这给了我相同的结果:最后一个输出被截断,表的结尾被删除missing@MagicP哪一行丢失了?@MagicP检查我的屏幕快照不明白。。。检查mine@MagicP我用python2和python3测试了我的代码。我发布了完整的代码,您可以粘贴并运行itThanks以获得答案,但这给了我相同的结果:最后的输出被截断,表的结尾被删除missing@MagicP哪一行丢失了?@MagicP检查我的屏幕快照不明白。。。检查mine@MagicP我用python2和python3测试了我的代码。我发布完整的代码,你可以粘贴并运行它
import os, time, string, operator, requests
from bs4 import BeautifulSoup

url='http://fse.vdkruijssen.eu/ferrylist.php'

params ={'selectplane':'Cessna 208 Caravan','submit':''}
response=requests.post(url, data=params)

soup = BeautifulSoup(response.text, "lxml")
table = soup.find(id="ferryplane")
for tr in table.find_all('tr', class_=True):  # filter the row that without text
    row = [cell.text for cell in tr.find_all('td')]
    print(row)
['HB-TCK', 'Badenflug (carbonex)', 'LSZS', 'LSMU', '67', '1000', '670', '348', '419']
['RPC-3255', 'Bank of FSE', 'WAMR', 'RPLV', '910', '110', '1001', '-3374', '-2405']
['I-FGTY', 'Bank of FSE', 'LGEL', 'LIBN', '284', '110', '312', '-1428', '-925']
['ZT-YMC', 'Bank of FSE', 'FLEB', 'FAUT', '1230', '110', '1353', '-4560', '-3251']
['CS-PRB', 'PRA Rentals (Matt74)', 'LZKZ', 'EDDK', '561', '175', '982', '-1908', '-1180']
['ZU-YTU', 'Bank of FSE', 'FABE', 'FAJS', '409', '110', '450', '-2008', '-1300']
['ZS-FXN', 'cckohrs', 'FYML', 'FALA', '548', '200', '1096', '-2668', '-1377']
['HL-7227', 'Bank of FSE', 'RJOB', 'RKSO', '360', '110', '396', '-1483', '-971']