Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Scrape text from website function never used? #54

Closed
Ashes47 opened this issue Oct 9, 2023 · 0 comments
Closed

[Question] Scrape text from website function never used? #54

Ashes47 opened this issue Oct 9, 2023 · 0 comments

Comments

@Ashes47
Copy link

Ashes47 commented Oct 9, 2023

Following function is never used:

def scrape_text_from_url(url):
	response = requests.get(url)
    if response.status_code != 200:
        return "Error: Could not retrieve content from URL."
    soup = BeautifulSoup(response.text, "html.parser")
    paragraphs = soup.find_all("p")
    text = " ".join([p.get_text() for p in paragraphs])
    print("web scrape done")
    return text`
@Ashes47 Ashes47 closed this as completed Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant