Skip to content
Advertisement

BeautifulSoup choosing a line from output

I try to make a python script that gets the dam occupancy rates from a website. Here is the code:

JavaScript

The output is like this:

JavaScript

Genel Doluluk Oranı means occupancy rate. I need the value of occupancy rate which writes in next line like 29,48. How can I get this value from output?

Advertisement

Answer

Cause question and expected result is not that clearly as mentioned I just point to the output of occupancy rate.

Get the value by split() the string

Prerequisite is that the value is always the last substring in string.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement