Skip to content

Instantly share code, notes, and snippets.

@Tomiwa-Ot
Last active June 1, 2021 20:30
Show Gist options
  • Select an option

  • Save Tomiwa-Ot/84ed4eb2573a2388fbf7d126b8d8e097 to your computer and use it in GitHub Desktop.

Select an option

Save Tomiwa-Ot/84ed4eb2573a2388fbf7d126b8d8e097 to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
import requests
text = ""
reqs = requests.get(url)
soup = BeautifulSoup(reqs.text, 'lxml')
for heading in soup.find_all("h3"):
print(heading.name + ' ' + heading.text.strip())
text = heading.text.strip()
print(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment