Kumakaja Kumakaja - 1 year ago 135
Python Question

BeautifulSoup html -- load from memory?

I'm using

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 Source
from BeautifulSoup import BeautifulSoup
import requests

data = requests.get('https://google.com').text
soup = BeautifulSoup(data)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download