Python Forum

Full Version: Beautifulsoup4 help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi iam trying to scrape some info from websites and i want to ask somebody who knows beautifulsoup if can show me how to get that price from this code.
beautifulsoup


Thank you
Should post code of what you have tried,and try not to post image as we can use code from it as a test.
from bs4 import BeautifulSoup

html = '''\
<b class="price price"> 206 </b>'''

soup = BeautifulSoup(html, 'lxml')
b_tag = soup.find('b', class_="price price")
print(b_tag.text.strip())
Output:
206
So this is the basic of it,now can price be generated bye JavaScript,
then look into Selenium(can still use BS as can redirect page_source to it) or try to catch json response.