I'm trying to make a web request that gets data from a specific website and prints it out on the console. For that I'm using Beautifulsoup and requests. You can see the HTML Data from the website below but I'm not getting the output of the 2 coordinates that you can see below. I don't know if it is important to mention, that the 2 coordinates on the webiste are constantly changing. Thanks for helping me!
HTML:
<div class="cockpitItem">
<h3>Bodenpunkt</h3>
<p id="gpt">
"42,67° Nord" #Coordinate 1 that I want to get
<br>
"170,38° Ost" #Coordinate 2 that I want to get
</p>
</div>
Python Code:
url = "https://www.astroviewer.net/iss/de/"
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
body = soup.find("p",{"id": "gpt"})
print(f"HTML: {body}")
print(f"Text: {body.text}")
Output:
HTML: <p id="gpt"> <br/> </p> #It finds the right part of the HTML data
Text: