Любая помощь приветствуется, я пытаюсь найти тег внутри таблицы в bs4, используя django, он показывает результат на консоли, но не работает на сервере VPS. Хотя, когда я пробую тот же код на локальном хосте, он работает.
Когда я пытаюсь получить доступ к тегу внутри bs4, отображается сообщение Nontype type, но тот же код отлично работает на локальном хосте
У меня та же версия python на сервере, а также на локальном хосте
Это мой код, который имеет проблемы на сервере
if soup.find('tbody').find_all('tr') is not None: #but here it gives us None_type tbody tag #soup not finding tbody tag
Это полный код
soup = BeautifulSoup(sorted_df.to_html(), "html.parser")
count = 0
for j in soup.find("thead").find_all('tr'):
if count == 0:
j.append(BeautifulSoup('<td><b><center>Next Result</center></b></td>', 'html.parser'))
count += 1
else:
j.append(BeautifulSoup('<td></td>', 'html.parser'))
modal_identifier = 0
print(soup,"HERE") #here it shows that soup has tbody tag in it
job_card = 0
if soup.find('tbody').find_all('tr') is not None: #but here it gives us None_type tbody tag #soup not finding tbody tag
i = 0
while ((soup.find_all("tr")) is not None) and i < len(soup.find_all('tr')):
temp = soup.find_all('tr')[i].find('th').text
print(temp, "TEMP")
soup.find_all('tr')[i].append(BeautifulSoup(
'<td><button type="button" class="btn btn-info btn-sm" data-toggle="modal" data-target="#myModal' + str(
modal_identifier) + '">Stations Detail</button><div class="modal fade" id="myModal' + str(
modal_identifier) + '" role="dialog"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Modal Header</h4></div><div class="modal-body"><h4>All Station & Timing</h4><p>' + str(
testing2[int(temp)]) + '</p><p>' + str(
testing3[int(temp)]) + '</p><p>' '</p><h4>Number Of Service Station</h4><p>' + str(
numberOfServiceStation[int(temp)]) + '</p><h4>Service Station Name & Timing</h4><p>' + str(
stationName[str(temp)]) + '</p><p>' + str(stationTime[int(
temp)]) + '</p></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div></div></div></div></td>',
'html.parser'))
i += 1
modal_identifier += 1
job_card += 1
результат показывает на консоли
![Console Results](https://i.stack.imgur.com/zdZoJ.png)
И это показывает ошибку на веб-странице
![enter image description here](https://i.stack.imgur.com/OKGxN.png)