add user object

This commit is contained in:
Adrian Malacoda 2016-11-26 23:14:09 -06:00
parent 933e178ce5
commit c04c030540

View File

@ -61,7 +61,7 @@ def scrape_thread (url):
thread = Thread(title=d("h2").text()) thread = Thread(title=d("h2").text())
for post_entry in d("article.post-entry"): for post_entry in d("article.post-entry"):
thread.children.append(Post( thread.children.append(Post(
author=pq(post_entry)("header > p > a").text(), author=User(name=pq(post_entry)("header > p > a").text()),
body=pq(post_entry)(".post-content-container").text() body=pq(post_entry)(".post-content-container").text()
)) ))