Sep-08-2021, 11:06 PM
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