You don't need to use wget
to download the HTML to a file then read it in, you can just get the HTML directly. This is using requests (way better than pythons urllibs in my opinion)
import requests
from bs4 import BeautifulSoup
url = "https://www.facebook.com/hellomeets/events"
html = requests.get(url).text
print html
This is an example using pythons built in urllib2
:
import urllib2
from bs4 import BeautifulSoup
url = "https://www.facebook.com/hellomeets/events"
html = urllib2.urlopen(url).read()
print html
Edit
I know see what you mean in the difference between HTML gotten directly from the website vs the HTML gotten from the wget
module. Here is how you would do it using the wget
module:
import wget
from bs4 import BeautifulSoup
url = "https://www.facebook.com/hellomeets/events"
down = wget.download(url)
f = open(down, 'r')
htmlText = "\n".join(f.readlines())
f.close()
print htmlText