Last active
July 18, 2018 04:27
-
-
Save erikgregorywebb/91256c08af01ed844c1235cef5ca2116 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getListings(url): | |
links = getListingLinks(url) | |
listings = [] | |
# Loop over each listing link | |
for i in range(0, 10): | |
time.sleep(3) | |
try: | |
listing = getListingContent(links[i]) | |
listings.append(listing) | |
except: | |
print("An error occured:", links[i]) | |
# Create DataFrame, clean variables | |
df = pd.DataFrame(listings, columns = ['title', 'location', 'price', 'views', 'favorites', 'description', 'name', 'link']) | |
return df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment