Getting concrete attribute within a HTML span tag
Question:
My problem:
I’m using beautiful SOAP in Python, and i want to know how do i get the concrete attribute such as "data-hk".
The output of the code is km/L, but i want the data about HK. How do i specifically select the right attribute within the span?
Many thanks in advance.
I tried the above code, and I’ve stated the result and output of it above.
Answers:
Try this:
HK = cars.find("span", class_="variableDataColumn")["data-hk"]
My problem:
I’m using beautiful SOAP in Python, and i want to know how do i get the concrete attribute such as "data-hk".
The output of the code is km/L, but i want the data about HK. How do i specifically select the right attribute within the span?
Many thanks in advance.
I tried the above code, and I’ve stated the result and output of it above.
Try this:
HK = cars.find("span", class_="variableDataColumn")["data-hk"]