title: How to access a value within the body of html using soup
body: <p>I am trying to access the live price of a crypto currency coin from an exchange webpage through python.</p>
  <p>The XPath of the value I want is in <code>/html/body/luno-exchange-app/luno-navigation/div/luno-market/div/section[2]/luno-orderbook/div/luno-spread/div/luno-orderbook-entry[2]/div/span/span</code> and I have been doing the following</p>
  <pre><code>from bs4 import BeautifulSoup as soup
  from urllib.request import urlopen as uReq
  exchage_url = 'https://www.luno.com/trade/markets/LTCXBT'
  uClient = uReq(exchange_url)
  page_html = uClient.read()
  uClient.close()
  page_soup = soup(page_html, &quot;html.parser&quot;)
  print(page_soup.html.body.luno-exchange-app.luno-navigation.div.luno-market.div.section[2].luno-orderbook.div.luno-spread.div.luno-orderbook-entry[2].div.span.span)
  </code></pre>
  <p>However the code doesn't work, due to the '-' in <code>print(page_soup.html.body.luno-exchange-app...)</code></p>
  <p>Is there a way to get that value I want?</p>
  <p>How I got the XPath:
  I pressed F12, right click the red box, and clicked &quot;Inspect&quot; which highlights a section in the html which I then right click, copy -&gt; XPath. Here is a picture to visually show the value I want <a href="https://i.stack.imgur.com/s52Zk.png" rel="nofollow noreferrer">The value I am interested in</a></p>