Giter Club home page Giter Club logo

Comments (21)

jayaddison avatar jayaddison commented on July 29, 2024

Thanks for the bugreport @jonzey231. What happened when you tried to run the script, and how did that differ from what you expected?

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

I don't know how to run it in the first place. I guess I'm asking for help on how to actually use this.

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

Ok, no problem - to confirm, you do have Python and pip installed, yep?

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

Correct. Both are installed in Windows.

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

Ok, great! Next up is to check whether you've been able to get this library (recipe-scrapers) installed -- and then let's figure out the first recipe for you to scrape. Have you begun reading the README file or should I give you some time to review that first?

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

I'm just getting scraper: command not found

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

Hrm, OK. Could you try running python before entering the next commands? Here's more-or-less the output you should get (the text on the first line will probably be different on your system):

> python
Python 3.12.4 (main, Jun 12 2024, 19:06:53) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from recipe_scrapers import scrape_me
>>> 

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

This is my output when I run python

>python
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

This is my output when I run python from recipe_scrapers import scrape_me

File "<stdin>", line 1
    python  from recipe_scrapers import scrape_me
            ^
SyntaxError: invalid syntax

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

Maybe I'm just not sure what command to actually run at this point?

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

Update: I misunderstood what you meant.

When I run python from recipe_scrapers import scrape_me this is the output:

\Desktop\recipe-scrapers-main>python from recipe_scrapers import scrape_me
python: can't open file 'Desktop\recipe-scrapers-main\from': [Errno 2] No such file or directory

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

That's OK, take your time. Could you try them as two separate commands?

  1. python - to open a Python interpreter session (the >>> should appear as a prompt).
  2. from recipe_scrapers import scrape_me - this is a statement within the Python session; we're asking it to import a function named scrape_me from this library.

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

Got it. Now I'm here:

Desktop\recipe-scrapers-main> python
Python 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from recipe_scrapers import scrape_me
>>>

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

Excellent :) OK. Do you have any particular recipe webpage that you want to scrape from, or should we choose one at random?

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

So my original hope was to just get all HelloFresh recipe URLs but it seems like that isn't going to be possible.

Let's use this one: https://www.hellofresh.com/recipes/vegan-firecracker-mushroom-rice-bowls-666863a6223895220f198073

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

Afraid not, yep - it's one URL at a time. We can use that one though, to get a sense for how the functionality works. That would be:

scraper = scrape_me('https://www.hellofresh.com/recipes/vegan-firecracker-mushroom-rice-bowls-666863a6223895220f198073')

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

Done!

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

Ok, we've got ourselves a scraper variable :) Now you should be able to use that to access the information from the recipe -- also, it's boring, but I should mention: please be responsible if re-publishing information from recipes (the core of recipes are not copyrightable in many places, but some aspects of the site's content may be).

>>> print(scraper.title())
>>> print(scraper.ingredients())

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

If it's OK with you: I'll edit the title of this thread because the discussion gives me a few ideas for how we can improve the top of our README file (so thank you!). If you'd prefer though, I can omit any references to this conversation when making those changes (and I'll leave the thread title as-is).

from recipe-scrapers.

jonzey231 avatar jonzey231 commented on July 29, 2024

Yes please and thank you for all the help! I think I've got it down. Have a great night!

from recipe-scrapers.

jayaddison avatar jayaddison commented on July 29, 2024

You're welcome - you too!

from recipe-scrapers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.