Commit 41119b77 by Ryan Lee

Expert data functions

parent 68a3a764
Showing with 31 additions and 0 deletions
def expert_data(soup):
"""
Take a soup object and return a string if it has an
expert co-author or if it has been quality tested
Input: soup object
Returns: String
"""
expert = soup.find("div", class_ = "sp_coauthor_label")
if expert != None:
if "Co-authored" in expert.text:
return "Expert Co-authored"
elif "Tested" in expert.text:
return "Quality Tested"
\ No newline at end of file
......@@ -139,3 +139,18 @@ def scrape_words(url):
return " ".join(text)
def expert_data(soup):
"""
Take a soup object and return a string if it has an
expert co-author or if it has been quality tested
Input: soup object
Returns: String
"""
expert = soup.find("div", class_ = "sp_coauthor_label")
if expert != None:
if "Co-authored" in expert.text:
return "Expert Co-authored"
elif "Tested" in expert.text:
return "Quality Tested"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment