Skip to content
Snippets Groups Projects
scraper.py 372 B
Newer Older
  • Learn to ignore specific revisions
  • Farhan Mohammed's avatar
    Farhan Mohammed committed
    import requests as r
    from bs4 import BeautifulSoup
    
    
    def scrape_webpage(link):
        resp = r.get(link)
        soupObject = BeautifulSoup(resp.content, "html.parser")
        text = soupObject.text
        return text
    
    
    t = scrape_webpage("https://news.yahoo.com/monterey-park-mass-shooting-everything-we-know-about-the-lunar-new-year-massacre-165348528.html?guccounter=1")
    print(t)