5 Functions for Web Scraping in Google Sheets

Поділитися
Вставка
  • Опубліковано 16 січ 2025

КОМЕНТАРІ • 48

  • @EamonnCottrell
    @EamonnCottrell  5 місяців тому

    ⭐⭐Grab the FREE demo sheet here - www.gotsheet.xyz/c/web-scraping-google-sheets-functions

  • @zoidoko7001
    @zoidoko7001 27 днів тому +1

    Very helpful, thanks

  • @jmathew6988
    @jmathew6988 10 місяців тому +1

    Very useful tutorial. Nicely explained. Very thoughtful of you to include the XPATH cheat sheet. Thanks for the tutorial!

    • @EamonnCottrell
      @EamonnCottrell  10 місяців тому

      Thanks! And you’re welcome too! Yeah, that cheat sheet is very useful.

  • @matiasmartinez6983
    @matiasmartinez6983 Рік тому +2

    muy bueno eamonn, justo lo que estaba buscando. Ahí va su like buen hombre

  • @jonathandorozowsky4005
    @jonathandorozowsky4005 Рік тому +1

    This is amazing! Subbed.

  • @kennethkang4749
    @kennethkang4749 День тому +1

    I have two items within the same class but I only need the second item to show how would I just select that one item?

    • @EamonnCottrell
      @EamonnCottrell  17 годин тому +1

      I believe this would work: =IMPORTXML(E4, "(//*[@class='CLASSNAME_HERE'])[2]")

  • @charlesmurray3255
    @charlesmurray3255 Рік тому +1

    some superior content here, tyvm

  • @asa_howard
    @asa_howard Рік тому +1

    Let's go! 🚀🚀🚀

  • @mikiallen7733
    @mikiallen7733 6 місяців тому +1

    can you provide example pls on the case of Google local guide reviews ? best

    • @EamonnCottrell
      @EamonnCottrell  6 місяців тому

      What do you mean exactly? Importing reviews from a Google Maps listing? I am not sure you could do something like that as those pages are loaded quite dynamically.

  • @chrisder1814
    @chrisder1814 8 днів тому +1

    Hello, could I write to you so that you can tell me what you think of my application ideas, if they are feasible?

  • @murataksu6496
    @murataksu6496 Рік тому +1

    Hi everyone. I’m beginner on Google sheet. Is there any platform for to find answers for questions???

    • @EamonnCottrell
      @EamonnCottrell  Рік тому +1

      Feel free to ask away on any of my videos; I'm very responsive and open to new topic ideas. The data and spreadsheet community on LinkedIn is also quite good. You can find me over there too - www.linkedin.com/in/eamonncottrell/

    • @murataksu6496
      @murataksu6496 Рік тому +1

      @@EamonnCottrell Thank you so much. I have some plans to learn a few programs/software after 45 years old. Spread sheets is one of them. Wish me luck!

    • @EamonnCottrell
      @EamonnCottrell  Рік тому

      @@murataksu6496 Good luck! I also have a newsletter with quick tips if you want to check it out here: got-sheet.beehiiv.com/

  • @abigailmapuladikobo9941
    @abigailmapuladikobo9941 8 місяців тому +1

    Importxml could not fetch data from a google scholar url. Why is this?

    • @EamonnCottrell
      @EamonnCottrell  8 місяців тому

      Curious. What's the url? These functions are definitely not foolproof, and some websites may not be able to be this easily scraped. There are a lot of variables.

    • @abigailmapuladikobo9941
      @abigailmapuladikobo9941 8 місяців тому

      @@EamonnCottrell "scholar.google.com/scholar?start=0&q=%22research+methods%22+AND+Africa+AND+training&hl=en&as_sdt=0,5" I tried to scrape the titles.

  • @senatiseguimiento
    @senatiseguimiento 7 місяців тому +1

    in the case that the web hv a login and password?

    • @EamonnCottrell
      @EamonnCottrell  7 місяців тому

      not a way to do this on a protected website using just these functions (that I'm aware of)...would need a more robust coding tool

  • @BenVost
    @BenVost 3 місяці тому

    My first import works, but writes the data in columns, not rows. This means that when I do the slug, the initial query no longer works because it would overwrite the slug query. This is my query =importxml(B1,"//*[@class='childpages-macro conf-macro output-block']"). Is there a way to force it vertically?

    • @BenVost
      @BenVost 3 місяці тому

      I've found that I can add a =TRANSPOSE() to surround the above line

    • @EamonnCottrell
      @EamonnCottrell  3 місяці тому +1

      I’d use the TOCOL or TRANSPOSE functions. Play around with these but I think they should get it in the format you’re looking for.
      You can probably wrap the import with one of these. Or import it and then transform once it’s in your sheet

    • @BenVost
      @BenVost 3 місяці тому

      @@EamonnCottrell Yes, I used =TRANSPOSE(importxml(C4,"/html/body/div[3]/article/div/div/div/ul[1]")) and it worked fine. I was right-clicking on the item in the inspector and choosing Copy XPath, but it doesn't seem as generic as the class I used before?

    • @EamonnCottrell
      @EamonnCottrell  3 місяці тому

      @@BenVost Yeah the last time I was working with xpath I hit some snags when copying the xpath like that. I expect it was user error but that's why I went more towards just looking for class names on the elements since it seemed more straightforward for what I was doing.

    • @BenVost
      @BenVost 3 місяці тому

      @@EamonnCottrell I've gone back to the class. I think it will be more flexible

  • @BenVost
    @BenVost 3 місяці тому

    How do I go deeper than the first page? I love the way you explained everything and I feel I now know enough to be dangerous 😆 Thank you so much

    • @BenVost
      @BenVost 3 місяці тому

      I managed to manually go deeper by using the link as my source, but it seems like almost as much work as writing the pages out by hand 😆

    • @EamonnCottrell
      @EamonnCottrell  3 місяці тому +1

      I've only ever referenced the page using the one url. I'm with you - got enough knowledge to be dangerous too 😂😂

    • @EamonnCottrell
      @EamonnCottrell  3 місяці тому +1

      @@BenVost lol yeah it can get a bit too much depending on the use case

  • @josephquijano9206
    @josephquijano9206 Рік тому +1

    You get me a subs. BTW bruh, can Google Sheet know if a specific word I want is inside a website? For example the word "Greatest" and i want the google sheet determine if it is in a website. thank you!

    • @EamonnCottrell
      @EamonnCottrell  Рік тому +1

      Cool idea! Yes...you could combine IMPORTXML with some logic to find this out. For instance, I could search for the word "Professional" in every on a web site using this formula (assuming the url is in A1):
      =IF(COUNTIF(ARRAYFORMULA(IMPORTXML(A1,"//div")),"*Professional*")>0,TRUE,FALSE)
      So you still need to feed it an element to look through like all the divs or h2s, but this'll do the trick👍

    • @josephquijano9206
      @josephquijano9206 Рік тому +1

      @@EamonnCottrell thanks for the tip! BTW, your videos in this channel are dopes. The editing looks like been making by a GOLD channel. Keep it up and you're in the right track!
      Also, if you can make a video where google sheet can check if an email is valid or invalid using a script. EVA email verifier seems can do the trick. God bless!

  • @DataFrenchy
    @DataFrenchy Рік тому +2

    🤘🤘🤘

  • @MuhammadFAH33M
    @MuhammadFAH33M 9 місяців тому

    Clear Explanation 👍
    Questions
    Will the important HTML Is up-to-date data from the source website? If no then please tell us a way to keep a live data
    2- I want to scrap ecommerce website product data, how to auto scrap Next page ?
    3- How about import data via json file url most e-commerce website uses it eg Shopify
    I'll be thankful if you please create an ecommerce website data scraping vidoe or share your tips so ill give it a try 🙂

    • @EamonnCottrell
      @EamonnCottrell  8 місяців тому +1

      You may want to explore more robust tooling like a plugin or python scripting if you need to handle refreshing/changing data often. But, yes, you can pull data from ecommerce sites using importhtml if the data in question is in a list or a table.
      Here's a note from Google on how data freshness is handled: support.google.com/docs/answer/12188454?hl=en#:~:text=To%20ensure%20users%20get%20fresh,and%20sheet%20don't%20change.

    • @MuhammadFAH33M
      @MuhammadFAH33M 8 місяців тому +1

      Dear@@EamonnCottrell
      Thanks for your prompt response.
      Yesterday i've tried to scrap e-commerce website but Google Sheet using ImportXML returns N/A Error.
      Even i've used Xpath Tools to validate my selections. They were working perfectly fine but for Google Sheet formula wasn't
      Looks like this solution is for simple sites which allow fetching info
      I'll look into the freshness of data via your suggested link 🖇️
      Thanks 😊

    • @EamonnCottrell
      @EamonnCottrell  8 місяців тому +1

      @@MuhammadFAH33M Yes, I expect that you'll need a more robust solution for bigger, more complicated sites. I have run into issues trying to get data for example from Amazon or similar ecomm sites in the past. ScrapingBee and Octoparse are two platforms I've heard of with a larger set of tools; some googling will get you the rest of the way there. Good luck!

    • @MuhammadFAH33M
      @MuhammadFAH33M 8 місяців тому

      @@EamonnCottrell Thank you so much for advanced software suggestions. i'll explorer them. ScrapingBee seems to be new to me :)

  • @AbuZikraBilal
    @AbuZikraBilal 2 місяці тому

    nice one but the memes/GIFs in between the video killed the joy.

  • @loistverberg900
    @loistverberg900 11 місяців тому +1

    Very helpful. But please nix the funny pictures. When I'm trying to follow something useful they are distracting.
    Don't forget that what seems simple to you is not to the people trying to learn from you. Cut out the stupid gifs and people will thank you.

  • @BL-zq7vd
    @BL-zq7vd 11 місяців тому +1

    dude why you want to look like a goofball on youtube ? u and a million others think looking like a goofball helps. it doesnt!