Spaces:
Runtime error
Runtime error
File size: 688 Bytes
60e3b0a 5505694 4161807 1fdb555 60e3b0a 1fdb555 60e3b0a 4161807 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import requests
from bs4 import BeautifulSoup
def process_webpage(url: str):
# Make a GET request to the page and get the HTML content
response = requests.get(url)
html_content = response.content
# Parse the HTML content using BeautifulSoup
soup = BeautifulSoup(html_content, "html.parser")
# Get all the text content from the relevant HTML tags
text_content = ""
for tag in ["p", "h1", "h2", "h3", "h4", "h5", "h6", "li"]:
for element in soup.find_all(tag):
text_content += element.get_text() + " "
print(text_content)
return text_content
if __name__ == "__main__":
process_webpage(url="https://www.meet-drift.ai/")
|