> For the complete documentation index, see [llms.txt](https://lauradang.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lauradang.gitbook.io/notes/web/web-scraping/beautifulsoup.md).

# Beautifulsoup

### Set up

```python
from bs4 import BeautifulSoup
import requests

source_start = requests.get(url)
soup = BeautifulSoup(source_start.text, 'lxml')
```

### Removing style tags

```python
[s.extract() for s in soup('style')]
```
