Mar-29-2019, 08:30 PM
Hi,
I'm scrapping a website and I don't know how to print only part for the text.
2008 xxxxx 7xxxxx
2 xxxx, xxx-xxx"
Sxxxxxx
ENGINE : Diesel
CAP: x,xxx lbs SKU: 1234
I just whant the ; " SKU: 1234 "
Thanks
I'm scrapping a website and I don't know how to print only part for the text.
from bs4 import BeautifulSoup import requests source = requests.get('http://www.website.com').text soup = BeautifulSoup(source, 'lxml') title = soup.find('div', class_='pr_title') print(title.text) sku = soup.find('div', class_='pr_infos') print(sku.text)The textx that comes out is like this :
2008 xxxxx 7xxxxx
2 xxxx, xxx-xxx"
Sxxxxxx
ENGINE : Diesel
CAP: x,xxx lbs SKU: 1234
I just whant the ; " SKU: 1234 "
Thanks