Эй, я пытаюсь прочитать все <p>
теги в массив.
HTML Пример:
<p>To test web scrapers against invalid markup we suggest scraping this page that contains the following markup mistakes:</p>
<p>It's obvious that not every web publisher pays much attention to validity of his HTML code.</p>
Это должно привести к массиву вроде:
scraped = ["To test web scrapers against invalid markup we suggest scraping this page that contains the following markup mistakes:","It's obvious that not every web publisher pays much attention to validity of his HTML code."]
Мой текущий код:
class Webscraper:
def fullscrape(self, url):
page = requests.get(url)
soup = BeautifulSoup(page.content, 'lxml')
content = soup.getText()
print(content)
Но, похоже, это не работает должным образом.