python remove html from a list item

Solutions on MaxInterview for python remove html from a list item by the best coders in the world

showing results for - "python remove html from a list item"
Alessandro
27 Jan 2020
1import requests
2from bs4 import BeautifulSoup
3
4URL = "https://www.ebay.com/sch/i.html?_from=R40&_nkw=oneplus%206t&_sacat=0&rt=nc&_udlo=150&_udhi=450"
5headers = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0'}
6page = requests.get(URL, headers=headers)
7soup = BeautifulSoup(page.content, 'html.parser')
8
9for price in soup.findAll("span", {"class": "s-item__price"}):
10    print(price.get_text(strip=True))
11
similar questions
queries leading to this page
python remove html from a list item