Spaces:
Build error
Build error
Download scraper.py from Munwar92/Customize_Multilingual_Chatbot: direct link, hf CLI and curl.
- Browser
- Download file 355 Bytes
-
https://huggingface.co/spaces/Munwar92/Customize_Multilingual_Chatbot/resolve/main/scraper.py
- Command line
-
hf download hf://spaces/Munwar92/Customize_Multilingual_Chatbot/scraper.py
-
curl -L -o scraper.py https://huggingface.co/spaces/Munwar92/Customize_Multilingual_Chatbot/resolve/main/scraper.py
355 Bytes
| import requests | |
| from bs4 import BeautifulSoup | |
| def scrape_website(url): | |
| try: | |
| response = requests.get(url) | |
| response.raise_for_status() | |
| soup = BeautifulSoup(response.content, 'html.parser') | |
| return soup.get_text(separator=' ') | |
| except Exception as e: | |
| return f"Error: Unable to scrape the website. Details: {e}" | |