Python download nested div
Question: I'm trying to find data on a div tag and download it, however, BeautifulSoup
returns 'none', as far as I can tell, not all divs are getting downloaded
which is the cause for BeautifulSoup not to find it.

    
    
    import requests
    from bs4 import BeautifulSoup
    
    #Get login information
    URL = raw_input("Enter the URL: ")
    username = raw_input("Enter the username: ")
    password = raw_input("Enter the password: ")
    
    
    #Start a session
    session = requests.Session()
    
    # Send login data
    login_data = {
    'user': username,
    'password': password,
    }
    
    # Authenticate
    r = session.post(URL, data = login_data)
    
    #Get page
    r = session.get(URL)
    html = BeautifulSoup(r.text)
    entry = html.find('div',{'class':'x-grid-empty'})
    
    #open file in binary mode
    file = open("Website.txt","wb") 
    file.writelines(str(entry))
    file.close()
    


Answer: If you're sure the problem lies with BeautifulSoup, then give `lxml` a try:
<http://lxml.de/>

In my experience lxml had been far more reliable.

If `requests` is the culprit however, then simply either upgrade your
requests, or use another tool, for one you can use the built-in
[urllib2](https://docs.python.org/2/library/urllib2.html).

