How To Scrape Woocommerce products with Python & requests-html

Поделиться
HTML-код
  • Опубликовано: 6 ноя 2024

Комментарии • 42

  • @MindBlowerWTF
    @MindBlowerWTF Год назад +2

    This is my second python project and while I'm sure I don't understand most of stuff done here, I made it work with your help.

  • @mattmovesmountains1443
    @mattmovesmountains1443 3 года назад +3

    Seeing the spreadsheet neatly arranged at the end of all this feels like I've done some sorcery.

  • @tubelessHuma
    @tubelessHuma 3 года назад +2

    More useful selectors. Thanks Dear John. 💖

  • @rjasim903
    @rjasim903 3 года назад +2

    I have some questions.
    How can we extract images url?
    Different variations, like size and color?
    Also how to extract description?
    Last as given code is not saving csv file please it would be great if you explain these things in next video.
    Best Regards

  • @BytesPH
    @BytesPH Год назад

    [₱81,495.00]
    How can i extract a price from this?
    thank you

  • @connorperzely6754
    @connorperzely6754 3 года назад +2

    If only it were this simple for Product Variants prices and attributes. I can't find a JSON object (for simple parsing) that contains the variant data and seems I'm forced into using Selenium. To get variant data I have to loop through, change the select inputs (to encapsulate all possible combos), and then record the data if there are products matching the select input filters. I noticed Shopify has a JSON object that you can easily parse but Woocommerce doesn't have it?

    • @JohnWatsonRooney
      @JohnWatsonRooney  3 года назад

      If you want to comment the shop name (urls will be auto removed) I can have a quick look

  • @ferilukmansyah3037
    @ferilukmansyah3037 3 года назад +1

    good tutorial ever !, thanks dear mr John

  • @KemalAcar
    @KemalAcar 2 года назад

    Invalid Syntax on number 42. Why?

    • @KemalAcar
      @KemalAcar 2 года назад

      Your code is sucks disliked.

  • @Jigyasu_RP
    @Jigyasu_RP 3 года назад +2

    Amazing! But one thing I wanna ask , how do you scrape prices of variable products (in woocommerce as well as in case of amazon products)? Is there any way to do it? Please let me know.

  • @mushinart
    @mushinart 3 года назад +1

    Cool work ,brotha

  • @davidtawiahglover7559
    @davidtawiahglover7559 3 года назад +1

    Love your Content ❤ !

  • @jagclub2005
    @jagclub2005 3 года назад

    awesome work thanks, i just need to add url for the product image and the url for the product, hope you can help. thanks

  • @LevelUpX
    @LevelUpX 3 года назад

    Thank you! Can you let me know how to scrape product variations?

  • @tulucartiom9412
    @tulucartiom9412 3 года назад

    Hello @John Watson Rooney, please help me. This method works perfectly for the front page. How can I remove all the information if I have 10 product pages? Thank you

  • @rogerhasemail
    @rogerhasemail 3 года назад +1

    nice sharing! how about AsyncHTMLSession? it would be much more efficient for multiple pages scraping

    • @JohnWatsonRooney
      @JohnWatsonRooney  3 года назад +1

      Sure, It’s something I am planning to cover!

    • @johnkennethadolfo5295
      @johnkennethadolfo5295 3 года назад +1

      @@JohnWatsonRooney I really love it if this AsyncHTMLSession would really happen hehehee please make it happen :D

  • @o-henry
    @o-henry 2 года назад +1

    Hmmm, was hoping there was some common woocommerce API that we could access. This method would still require me to write a scaper for each new site I wanna scrape

    • @JohnWatsonRooney
      @JohnWatsonRooney  2 года назад +1

      Yes I’m afraid so, although they are all structured very similar so should be able to write one and adapt it

  • @ProjectSkillsQMUL
    @ProjectSkillsQMUL 3 года назад +1

    If I apply this method, how do you also scrape all the available pages? They are randomised URLs to prevent scraping but you can select the next page button by css or xpath. Sorry, I am extremely new to web scraping and python. Haven’t seen any examples of URLs when they become randomised

    • @JohnWatsonRooney
      @JohnWatsonRooney  3 года назад

      finding the sitemap is a good place to get all the links to the categories, but if its pages you are after you can scrape the next page link from each page your working on and then request the data from there

    • @ProjectSkillsQMUL
      @ProjectSkillsQMUL 3 года назад

      @@JohnWatsonRooney Thanks for the reply, I hope you are in good health. Unfortunately, the website I'm trying to scrape blocks requests-html and splash. I am trying to learn Playwright for Python as an alternative to Selenium but since I only started coding two weeks ago I'm finding it difficult. Would appreciate if you could consider making a video on the tool? Thank you :)

  • @burgasHoH
    @burgasHoH 3 года назад +1

    Amazing video and content !

  • @KhalilYasser
    @KhalilYasser 3 года назад +1

    Amazing as usual. Thank you very much. Did you post the code on GitHub?

    • @JohnWatsonRooney
      @JohnWatsonRooney  3 года назад +1

      always forget.. added to the description! thanks!

  • @achajackson5898
    @achajackson5898 2 года назад

    ImportError: No module named requests_html
    I have installed it with pip and pip3 but still does not work.

  • @murtazakalang7720
    @murtazakalang7720 2 года назад

    I can't get any data from website where flex box is there.

  • @tanchunyeejoey8726
    @tanchunyeejoey8726 3 года назад

    Hi, any idea on how to scrape the add-to-cart variance?

  • @georgegomes5344
    @georgegomes5344 3 года назад

    TypeError: get() missing 1 required positional argument: 'url'. Any idea why I am getting this?

    • @AbdihanadMohamed
      @AbdihanadMohamed Год назад

      damn bro its been 2 years, you prolly know it now but I guess you needed to pass a url to the get(), like how you get something without knowing what to get, that reminds me of my manager that keeps telling me to get a task done without describing it properly

  • @husnainraza1604
    @husnainraza1604 3 года назад

    How can I scrap en.52wmb dot com and import key dot com please help.

  • @shoebshaikh6310
    @shoebshaikh6310 3 года назад +1

    Wow❤️

  • @sseemm
    @sseemm 2 года назад

    Why you didn't use r.html.render()
    And is there a condition to use it or not?

    • @JohnWatsonRooney
      @JohnWatsonRooney  2 года назад +1

      We only need to use render when we want the chrome instance to load the page - for JavaScript sites

    • @sseemm
      @sseemm 2 года назад

      @@JohnWatsonRooney thanks John 👌

  • @anug4246
    @anug4246 4 месяца назад

    Having trouble extracting price!!

  • @thebossofdd1518
    @thebossofdd1518 3 года назад +1

    Can you make one for shopify?

    • @JohnWatsonRooney
      @JohnWatsonRooney  3 года назад

      I have an older video here that exlpains a good way to scrape Shopify stores: ruclips.net/video/jPjxWC7zV2s/видео.html

  • @vampirekabir
    @vampirekabir 3 года назад

    why not scrapy?