Добрый день,
Я очень плохо знаком с Python и подумал, что простой веб-лом будет легко набрать asp, однако у меня возникла проблема с выводом моего запроса. запрос выглядит следующим образом:
import pandas as pd
import requests
from bs4 import BeautifulSoup
page = requests.get('https://www.ebuyer.com/store/Components/cat/Processors-AMD/subcat/AMD-AM4-Ryzen-5')
soup = BeautifulSoup(page.content, 'html.parser')
#print(soup)
week = soup.find(id='grid-view')
#print(week)
items = week.find_all(class_ = 'grid-item js-listing-product')
#print(items[0])
#print(items[0].find(class_='grid-item__title').get_text())
#print(items[0].find(class_='grid-item__ksp').get_text())
#print(items[0].find(class_='price').get_text())
product_description = [item.find(class_='grid-item__title').get_text() for item in items]
#sub_descriptions = [item.find(class_='grid-item__ksp').get_text() for item in items]
#price = [item.find(class_='price').get_text() for item in items]
print(product_description)
вывод выглядит как: ['\ n \ n AMD Ryzen 5 3600X AM4 CPU / Processor с Wraith Spire Cooler \ n \ n', '\ n \ n AMD Ryzen 5 1600X 6 Core AM4 CPU / Processor \ n \ n ']
Я хотел бы иметь возможность удалить' \ n \ n из текста, если это возможно?
Заранее спасибо.