Kumakaja Kumakaja - 26 days ago 16
Python Question

BeautifulSoup html -- load from memory?

I'm using

BeautifulSoup
in python 3.5 to parse html. While I can load it from file, I need to load it from memory because I get from an HTTP request. I've google but found nothing loading html to BeautifulSoup from memory. Is it possible?

Answer
from BeautifulSoup import BeautifulSoup
import requests

data = requests.get('https://google.com').text
soup = BeautifulSoup(data)