hhursev / recipe-scrapers

Python package for scraping recipes data
MIT License
1.75k stars 535 forks source link

which file do I run to run the scraper? #1250

Closed Lilahjane closed 1 month ago

Lilahjane commented 2 months ago

so I'm a pretty new developer and I have read through all the getting started guides and I'm really lost. there are a lot of files and I cant seem to find the one where I input a url and it returns with the data I want. if someone could explain how on earth I get this to run I would be so grateful I use windows so I don't know if that changes anything. If someone could reach out and explain what I need to know I would be so happy!

jayaddison commented 2 months ago

Hi @Lilahjane! This library should be usable on Windows too, so let's find out what we can do.

Do you have recipe-scrapers installed already, and if so, could you confirm what version?

Lilahjane commented 2 months ago

Requirement already satisfied: recipe-scrapers in c:\users\lilah\appdata\local\programs\python\python312\lib\site-packages (14.56.0)

jayaddison commented 2 months ago

Ok, thanks! In version 14.56.0 (the existing one you have installed), the scrape_me function accepts a single URL and - if all goes well - that'll return a Python object that you can use to access the recipe's information.

Lilahjane commented 2 months ago

would it be possible to make this repo a flask api. Also took a look at your repos and I think you could help me with my project if your interested I don't believe I can privately message on GitHub but I'm trying to use this scrapper as a way to add recipes to my application I hope this doesn't come off as odd but I could really use some guidance

jayaddison commented 2 months ago

Ok, yep - Flask's a good choice for building web APIs using Python. And it is possible to combine the code from recipe-scrapers here with it.

Could you describe some more about what you'd like your application to do? There might be some existing sample code that I could provide a link to, or perhaps we could develop another.

Lilahjane commented 2 months ago

So my application schematics is a meal planner I’m trying to build using angular and I’ve realized as I’ve gotten further into devlopment that I need to build a backend to manage my data like filtering deleting and adding recipes which is where I believe this repo could help I dont know where/how to start building an add recipe function to my app from what I can gather I should build an api endpoint to the scraper and when a url is provided the scrapper runs, I reformat/rename the output from the scraper and display it but the implementation to do this is beyond me I hope this makes sense because I have so many thoughts going on at once lol

jayaddison commented 2 months ago

Ok, thank you - good luck with developing the application!

Unless this issue thread is about developing recipe-scrapers specifically (and that can include documentation), I don't think I can help much further.

However, I can recommend Michael Grinberg's tutorial about RESTful API design using Flask: https://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask -- note that you'll want to install a program called curl in order to follow along with the guidance in that tutorial.