Skip to content

Instantly share code, notes, and snippets.

@m-note
Created October 15, 2015 07:58
Show Gist options
  • Save m-note/25f5f0781368e7b6a015 to your computer and use it in GitHub Desktop.
Save m-note/25f5f0781368e7b6a015 to your computer and use it in GitHub Desktop.
title_list.append((element.find_all("h3"))[0].contents)
#<a href="http://togetter.com/li/887196">
#<h3 title="TITLE">TITLE</h3>
#</a>
page_url_list.append((element.find_all("a"))[0]["href"])
#<a href="http://togetter.com/li/887196">
category_temp = element.find_all("a", {"class":"category_link"})
category_list.append(",".join([i.contents[0] for i in category_temp]))
#<a class="category_link" href="http://togetter.com/top/social">社会</a>,<a class="category_link" href="http://togetter.com/top/social/10">政治</a>
view_num_list.append(int(((element.find_all("span", {"class":"view_str"}))[0].contents)[0].get_text()))
# span class="view_str"><span>502</span> view</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment