{{ message }}
added daily horoscope scrapper script - #2167
Merged
Merged
Conversation
added daily horoscope scrapper script
cclauss
requested changes
Jul 3, 2020
Member
There was a problem hiding this comment.
Cool submission!, Lines 18-23 are the core of your algorithm so let’s put those lines into a function:
def horoscope(zodiac_sign: int, day: str = "today") -> str:
url = ('https://www.horoscope.com/us/horoscopes/general/'
f'horoscope-general-daily-{day}.aspx?sign={zodiac_sign}')
soup = BeautifulSoup(requests.get(url).content, 'html.parser')
return soup.find('div', class_= 'main-horoscope').p.textThen move all the input() and print() code into __main__. This would allow someone else to easily put your algorithm into a bigger project. print(horoscope(8))
Member
There was a problem hiding this comment.
According to CONTRIBUTING.md algorithm functions should not print()
code refactoring, script editing
cclauss
requested changes
Jul 10, 2020
cclauss
approved these changes
Jul 10, 2020
stokhos
pushed a commit
to stokhos/Python
that referenced
this pull request
Jan 3, 2021
* added daily horoscope scrapper * Update daily horoscope scrapper script code refactoring, script editing * Update web_programming/daily_horoscope.py Co-authored-by: Christian Clauss <cclauss@me.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.