alexanderholt
10/25/2017 - 3:20 PM

Joe Scrape Get

from bs4 import BeautifulSoup
import urllib

# set the url we want to visit
url = "http://www.opentable.com/washington-dc-restaurant-listings"

# visit that url, and grab the html of said page
html = urllib.request.urlopen(url).read()

# we need to convert this into a soup object
b = BeautifulSoup(html, 'lxml', from_encoding="utf-8")

for name in b.find_all(name='span',class_='rest-row-name-text'): # creates soup element instead of list
    print(name.text) #returns string
    #renderContents() works if you want to do a byte