Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. request = requests.get("http://www.osta.ee/muruniiduk-cc-46-pb-kodumaailm-67868467.html")
  4. content=request.content
  5. soup = BeautifulSoup(content, "html.parser")
  6. element= soup.find("span", {"class": "sum", "id":"current-price"})
  7. string_price = print(element.text.strip())
  8.  
  9. #<span class="sum" id="current-price" itemprop="price">512.82</span>
  10. #print(request.content)
  11. #slicing: price_without_symbol=string_price[1:]
  12. #print(float(price_without_symbol))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement