-
Notifications
You must be signed in to change notification settings - Fork 531
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
Added scraper for Drinkoteket.se #1043
base: main
Are you sure you want to change the base?
Conversation
def yields(self): | ||
return 1 |
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.
Thank you, @Pebkac03!
The only quibble I have is this return 1
. I guess it makes sense that most/all of the recipes will be for a single instance of whatever cocktail is being prepared. Could you check for counter-examples even so?
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.
Thanks, you're right. Found that some recipes where for two servings. Will probably work on it tomorrow.
else: | ||
raw_list = ingredients_element.findAll("span")[0::2] | ||
|
||
ingredients = [i.getText().strip() for i in raw_list] |
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.
A small cleanup suggestion:
ingredients = [i.getText().strip() for i in raw_list] | |
ingredients = [i.text.strip() for i in raw_list] |
Hi @Pebkac03, just a quick note. If you add |
Thanks, I will do that. I realized that the site has a tendency of not having a standard way of doing many things leading me to suspect a substantial risk of annoying edge cases requiring a lot of testing to be certain of it being bug-free which I currently do not have the time for. You could either merge it as is if you want, there are very few recipes with a differing serving amount or if you feel it needs to be more stable, mark it as a draft and I'll do it sometime in the future unless anyone else wants to contribute. |
I've added a scraper for Drinkoteket.se.
This one was a bit tricky with the ingredients since they don't provide amounts in their schema. This works by parsing a list from the HTML with ingredients and then removing everything below the separator since those elements aren't part of the ingredients.
Resolves #1042