Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23218

Get the data in the Span class of HTML by Python

$
0
0

I am trying to get the data in one of span class from a website. Currently, I caught the correct position of my data but I can't get the text of class.

My code:

import requestsfrom bs4 import BeautifulSoupres = requests.get('https://coinmarketcap.com/currencies/chainlink/')soup = BeautifulSoup(res.text, 'lxml')elements = soup.find_all("span", class_="sc-f70bb44c-0 flfGQp flexStart alignBaseline")values = soup.find_all("span", class_="sc-f70bb44c-0 jxpCgO base-text")print(values)

My output:span class="sc-f70bb44c-0 jxpCgO base-text">$14.22</span

My expectation is get the only "$14.22"


Viewing all articles
Browse latest Browse all 23218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>