-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unitreeのメールに星座占いを追加 #1
unitreeのメールに星座占いを追加 #1
Conversation
めっちゃいい感じですね! |
4: ":astonished:", 5: ":cry:", 6: ":angry:", 7: ":flushed:", | ||
8: ":scream:", 9: ":heart_eyes:", 10: ":wink:", 11: ":sleepy:", 12: ":sweat:"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
全角スペースが入っているような気がします
soup = BeautifulSoup(response, "html.parser") | ||
fortune = soup.find('div', id="jumpdtl").find_all('td') | ||
f_contents = soup.find('div', class_="yftn12a-md48").find_all('dd')[0].contents[0] | ||
rank = fortune[-5].contents[0].contents[0][0:2] | ||
point_overall = fortune[-3].contents[0].attrs['alt'] | ||
point_love = fortune[-3].contents[0].attrs['alt'] | ||
point_money = fortune[-2].contents[0].attrs['alt'] | ||
point_business = fortune[-1].contents[0].attrs['alt'] | ||
message = "今日の星座占い:いて座の運勢は【" + rank + "】" + add_comment_rank(int(rank[0])) + "\n" | ||
message += f_contents + "\n" | ||
message += "だって!\n" | ||
message += "\n" | ||
message += "総合運: " + point_overall + "\n" | ||
message += "恋愛運: " + point_love + add_comment_love(int(point_love[-2])) + "\n" | ||
message += "金運: " + point_money + add_comment_money(int(point_money[-2])) + "\n" | ||
message += "仕事運: " + point_money + add_comment_business(int(point_business[-2])) + "\n" | ||
response.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この部分はpython2系でも動く気がするのでインデントを一つ上げてelseから出しておいても良いかと思いました.
早速のご対応ありがとうございます!
|
euscollada is now released on noetic
@tkmtnt7000
スパーキーのメールに星座占いを追加してみました。お時間ある時に試してみてほしいです。実行に
pip install emoji
が必要です関数での動作は確認済みですが、このスクリプトはすぐ手元で動かせず動作確認できていないのでエラー等吐いたらお知らせください。お手数おかけして申し訳ないです...。
よろしくお願いします
k-okada#24