Python Forum
BeautifulSoup returning text as N/A
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BeautifulSoup returning text as N/A
#1
I'm trying to get the text value from the below html, so I should be getting FFT606, but when I run my Python code I'm getting n/a. Please help.

<span>id="highlighted_callsign">FFT606</span>
from bs4 import BeautifulSoup
import requests

url = 'https://globe.adsbexchange.com/?icao=ad627d'

r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
div = soup.findAll('div',attrs={'id':'layout_container'})
for d in div:
    s = (soup.find('span'))
    print(s.text)
Output:
n/a
Reply


Messages In This Thread
BeautifulSoup returning text as N/A - by tantony - Sep-08-2021, 11:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python BeautifulSoup gives unusable text? dggo666 0 1,489 Oct-29-2021, 05:12 AM
Last Post: dggo666
  Python 3.9 : BeautifulSoup: 'NoneType' object has no attribute 'text' fudgemasterultra 1 9,130 Mar-03-2021, 09:40 AM
Last Post: Larz60+
  Selenium returning web element instead of desired text newbie_programmer 1 5,321 Dec-11-2019, 06:37 AM
Last Post: Malt
  BeautifulSoup 'NoneType' object has no attribute 'text' bmccollum 9 14,910 Sep-14-2018, 12:56 PM
Last Post: bmccollum

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020