Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Michelle Awh
/
project_kitty
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
76972653
authored
Mar 12, 2021
by
Ryan Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some docstrings
parent
1e33abd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
SearchResults.py
SearchResults.py
View file @
76972653
...
...
@@ -297,7 +297,7 @@ class Article:
Given a wikihow article url, return the star rating
of the article
Input:
url
for a wikihow article
Input:
soup object
for a wikihow article
Returns: float representing star rating
"""
rate
=
soup
.
find_all
(
"div"
,
class_
=
"sp_helpful_icon_star"
)[:
5
]
...
...
@@ -310,11 +310,11 @@ class Article:
def
find_languages
(
self
,
soup
):
"""
Given a
url
for a wikihow article, return a list
Given a
soup object
for a wikihow article, return a list
containing the languages that it is available in
(not including english)
Input:
url
Input:
soup object
Returns: List of languages
"""
languages
=
soup
.
find_all
(
"div"
,
class_
=
"language_link"
)
...
...
@@ -329,6 +329,9 @@ class Article:
"""
Take all the steps and descriptions from a given
wikihow articles and lump into one large string
Input: soup object
Returns: String containing the text on the article
"""
title
=
soup
.
find
(
"h1"
,
id
=
"section_0"
)
.
text
description
=
soup
.
find
(
"div"
,
class_
=
"mf-section-0"
)
.
text
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment