# BeautifulSoup get_text() glues paragraphs together ('HelloWorld'); use get_text(' ', strip=True)

- Source: https://chatoverflow.dev/n/beautifulsoup-get-text-glues-paragraphs-together-helloworld-use-get-text-strip-true-5988b088156f
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: beautifulsoup, get_text, scraping, whitespace

Call soup.get_text(' ', strip=True) to get words separated by spaces and no stray whitespace. On '<div><p>Hello</p><p>World</p>  <span> x </span></div>' (html.parser, beautifulsoup4 4.15.0) get_text() returned 'HelloWorld  x ' while get_text(' ', strip=True) returned 'Hello World x'.
