Web Scraping in Google Sheets! (IMPORTXML FUNCTION)

Get Stock data directly into your sheets and download my sheets: tickerdata.com/
In this video, I show you step by step how to use the =IMPORTXML function to web scrape in google sheets. Using this function has allowed me to build extremely powerful and useful spreadsheets, which you can see in many of the videos on my channel.
Get 50% off of Seeking Alpha Premium!
www.sahg6dtr.com/9D5QH2/R74QP/
I am not a Financial advisor or licensed professional. Nothing I say or produce on KZread, or anywhere else, should be considered as advice. All content is for educational purposes only. I am not responsible for any financial losses or gains. Invest and trade at your own risk
Follow me on Twitter: / dividendology
Join my Discord! / dividendology .
#WebScraping #IMPORTXML #GoogleSheets

Пікірлер: 166

  • @jivepatrol6833
    @jivepatrol68332 жыл бұрын

    This is a great video and I appreciate you putting it together! Thank You 🙂🙂

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    You are welcome! I’m glad you enjoyed.

  • @TheWinghochui
    @TheWinghochui3 ай бұрын

    Thanks for your sharing!

  • @ianbraganza5795
    @ianbraganza5795 Жыл бұрын

    Great video! I'm blown away by this feature. Didn't realize it was that easy to scrape without using code

  • @antonlindberg7117
    @antonlindberg7117 Жыл бұрын

    Mindblowing stuff! I just managed to web scrap off another website based on the principles here! Thanks for teaching me something new!

  • @Dividendology

    @Dividendology

    Жыл бұрын

    Fantastic! Glad it helped!

  • @IndianDividendInvestor-sm3xc
    @IndianDividendInvestor-sm3xc8 ай бұрын

    Thanks brother much appreciated simple and quick.

  • @robertogalvan5887
    @robertogalvan5887 Жыл бұрын

    Thank you so much for this!!!

  • @JatilenggerTV
    @JatilenggerTV2 жыл бұрын

    Very interesting and useful. Great content for all of us data nerds. Thanks!

  • @luiscastroalcala7576
    @luiscastroalcala7576 Жыл бұрын

    Thank you so much from Perú . you re the best.

  • @Dividendology

    @Dividendology

    Жыл бұрын

    You're welcome!

  • @KnowArt
    @KnowArt Жыл бұрын

    yasss this is what I was looking for (I think... let's see if it actually works)

  • @davidmyre965
    @davidmyre9652 жыл бұрын

    Great content for all of us data nerds. Thanks!

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    You are welcome!

  • @mk05022
    @mk05022 Жыл бұрын

    Awesome, thank you!

  • @Dividendology

    @Dividendology

    Жыл бұрын

    You're welcome!

  • @opportunityseeker-dm6yp
    @opportunityseeker-dm6yp3 ай бұрын

    damn!thank you for this brother super super great information

  • @dogtown1ewok
    @dogtown1ewok2 ай бұрын

    Thanks lad!

  • @msvec12
    @msvec126 ай бұрын

    I have been looking for YEARS for a formula that would help me pull NBA win totals automatically -- this finally did it. Thank you so much!

  • @Dividendology

    @Dividendology

    6 ай бұрын

    You're welcome!

  • @KnowArt
    @KnowArt Жыл бұрын

    doesn't seem to work on views on youtube videos or instagram etc etc. But does work on the data you show in the video. How come?

  • @TheCPelsor
    @TheCPelsor Жыл бұрын

    You've got to be kidding me... This is next level awesome. THANK YOU!!!

  • @Dividendology

    @Dividendology

    Жыл бұрын

    You’re welcome!!

  • @trustan3079
    @trustan307911 ай бұрын

    Thank you for this! :)

  • @Dividendology

    @Dividendology

    11 ай бұрын

    You're so welcome!

  • @chrissis111
    @chrissis111 Жыл бұрын

    You have the best stock videos for beginners!

  • @Dividendology

    @Dividendology

    Жыл бұрын

    Thanks!!

  • @ttone2330
    @ttone2330 Жыл бұрын

    Big Thumbs up to you.... Thanks

  • @Dividendology

    @Dividendology

    Жыл бұрын

    Thank you too!

  • @SerdarTokcan
    @SerdarTokcan Жыл бұрын

    Thank you :)

  • @mubeenkhan8877
    @mubeenkhan8877 Жыл бұрын

    Thank you so much you saved my whole month 😘

  • @mikkelhansen782
    @mikkelhansen782 Жыл бұрын

    Quick question, what if the stocks I want to look at is not a US stock and the stock is listed on an other stockexhange? then the stock have a little more to its ticker, but when I try to add CO/CPH (it's a danish stockexhance) then the scraping just says Error or N/A what to do?

  • @willbreece
    @willbreece2 жыл бұрын

    Very interesting

  • @user-dx7rp2em8n
    @user-dx7rp2em8n4 ай бұрын

    How can you pull variable data from a webpage? example: Only business addresses from a listing page that gives you multiple addresses and full descriptions of each address in between the addresses. How do you scrap specific variable data like that into a spreadsheet keeping it organized and separate from the other data?

  • @Oreox4
    @Oreox48 ай бұрын

    wow what the heck this is awesome

  • @jmr
    @jmr3 ай бұрын

    Modern tools make this so much easier!

  • @MohitBadgotra-of7xu

    @MohitBadgotra-of7xu

    2 ай бұрын

    WHICH TOOLS PLEASE TELL ME

  • @jmr

    @jmr

    2 ай бұрын

    @@MohitBadgotra-of7xu In this case the "tool" is Google sheets. In the past I had to write programs and use functions like split or import libraries like beautiful soup and requests. Then you have to deal with error handling. One change to the page or a 404 and your entire program might crash. Often I had to reformat the data and correct character sets too. That really sucks because the errors you see aren't obvious. There is a strange version of the quotation mark you run into a lot when scraping the web. It looks the same to the untrained eye but will break stuff if you don't catch it. Google sheets in this case makes it MUCH easier.

  • @MohitBadgotra-of7xu

    @MohitBadgotra-of7xu

    2 ай бұрын

    @@jmr thank you for such a great information

  • @jmr

    @jmr

    2 ай бұрын

    @@MohitBadgotra-of7xu You're welcome. I hope it helps.

  • @theDemolisher13
    @theDemolisher1311 ай бұрын

    Great. Though I got a question what would you do if you got to a store front page that offered a price range that varies based on different options the user could pic but selecting the different options don't change the URL?

  • @user-ih1dp8fn5k
    @user-ih1dp8fn5k5 ай бұрын

    Ty so much

  • @tp8706
    @tp8706 Жыл бұрын

    This is great but I tried this and for some reason it says “Imported Content is Empty”. Then I tried the same thing you did for Kobe but got the same error. Is yours still working?

  • @muhammadkashifrashidawan9417
    @muhammadkashifrashidawan9417 Жыл бұрын

    great video I learn a lot but this term is not successfully applied in my scenario because i am looking to pull meta description but my code shows me "empty data" what is the solution? thanx

  • @user-pc8jh6rj9q
    @user-pc8jh6rj9q7 ай бұрын

    What would you do in the case that a website you're pulling prices from requires a log in? I have the login for the specific site i'm referencing, but what if you don't as well? More curious on how to do it if you have the login. For example, if I get specialty pricing from a hardware store that's only visible via my login, how would I automate that extraction?

  • @lmac222
    @lmac2228 ай бұрын

    Thanks for making this. It helps tremendously. My one question is, is it a different function to pull in a chart/graph of a stocks trend? I tried importxml and followed the steps and i get an error (formula parse error). Any help?

  • @TheCompoundingInvestor
    @TheCompoundingInvestor2 жыл бұрын

    Very interesting and useful. Will it auto refresh the page so you can see it update in real time? Or do you have to manually refresh the page somehow?

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    Google sheets automatically refreshes typically around every 20 minutes.

  • 2 ай бұрын

    Thank you for this helpful tutorial but is there a way to automatically update the data ?

  • @trader_gian
    @trader_gian Жыл бұрын

    Hi! I’ve tried the formula to import the full xpat section but now the cell return #N/D so can’t find the object at the url. Any suggestions?

  • @sanjayvaradharajan

    @sanjayvaradharajan

    Жыл бұрын

    did you find a fix? im getting the same issue

  • @EmanzASR12

    @EmanzASR12

    5 ай бұрын

    Remember to check the correctness of the URL and XPath. Additionally, keep in mind that some websites may prevent or restrict access through the IMPORTXML function due to security restrictions or to prevent unauthorized web scraping. If the issue persists, it might be helpful to verify whether the website in question allows access and data extraction using the IMPORTXML function. Also, consider using more advanced tools such as APIs or scripts for extracting data from web pages.

  • @thswan
    @thswan Жыл бұрын

    nice video, thanks for posting! I've got two questions. 1) I get a N/A cell and the error is "could not fetch the url". What is the cause of this and is there any workaround? 2- Is there any way with this method to see the values changing in real time? thank you!

  • @sawyersahagun2073

    @sawyersahagun2073

    Жыл бұрын

    Is the site you’re trying to pull from password protected?

  • @ricardoortiz6000

    @ricardoortiz6000

    Жыл бұрын

    @@sawyersahagun2073 i get the same error, and yes the site is password protected

  • @sadashivb5100
    @sadashivb51002 жыл бұрын

    Nice video...but more than 100 ticker its take to mach time to update so any other idea to track revenue details.....

  • @bonchanz
    @bonchanz3 ай бұрын

    Thank you nice, on the Home Screen in Yahoo its work, but not for the Split statistic. Can you make this for maybe divident yield...😊

  • @sandeepkumar-js3gi
    @sandeepkumar-js3gi Жыл бұрын

    Thanks , your video is very good. But when I use this formula, error come is - import data is empty...Pls help

  • @sandeepkumar-js3gi

    @sandeepkumar-js3gi

    Жыл бұрын

    Can u help me in this..

  • @giovannicapuano9729
    @giovannicapuano9729 Жыл бұрын

    hello, what can i do when the website doen't allow the web scraping? how can i import table in this case? thanks

  • @prins1991
    @prins19916 ай бұрын

    I didn't know this was possible. Thank you for this tutorial! 🤗🤗

  • @fedepasco8309
    @fedepasco8309 Жыл бұрын

    Buenos días. Consulta, porque al traer un dato de una pagina de cotizaciones, redondea el mismo y además no coincide en cantidad. El dato es 151.00 y me trae 1.600.000. Gracias

  • @sandeepkumar-js3gi
    @sandeepkumar-js3gi Жыл бұрын

    Hi, great video, pls tell link will auto updated....

  • @dbarrantescr
    @dbarrantescr Жыл бұрын

    Has anyone tried scraping from YH subsection pages like "Statistics" or "Financials" sections? I have tried scraping from there using importhtml and importxml and both seem to fail (only working in summary page)

  • @xyungn9860

    @xyungn9860

    11 ай бұрын

    Cant get it to work either

  • @CrescentCaribou
    @CrescentCaribou10 ай бұрын

    When I try to pull prices from Etsy, it comes up as "Price: $1.70 Loading" instead of "$1.70". Is there a way to get just the price, or will I just have to deal with it? It also only works sometimes with Etsy, the xpath doesn't seem to be the same on every page and I can't always find the right part to highlight... It's similar with Amazon, if the price is $5.27 the $, 5, and 27 seem to be on different parts of the code so I can't figure out what to paste

  • @hotdoggyboomboom411
    @hotdoggyboomboom4116 ай бұрын

    thanks but some sites like similar web wont let to scrape data any methods for that . ?

  • @Henry_Nunez
    @Henry_Nunez Жыл бұрын

    Very good 👉🔔

  • @hameesahmed417
    @hameesahmed417 Жыл бұрын

    Hi bro, I want to import amazon product prices using URLs. But no matter what I do , my content is always empty. Can you help/

  • @johnbezos4171
    @johnbezos4171 Жыл бұрын

    Hey any idea how importing google trends values for a period works?

  • @rathinmondal2001
    @rathinmondal20012 ай бұрын

    Thanks for this video. I am able to fatch data from any site to sheet. This is very helpful . Thanks again.

  • @Dividendology

    @Dividendology

    2 ай бұрын

    You’re welcome!

  • @evaltanful
    @evaltanful8 ай бұрын

    Thx

  • @pincer2885
    @pincer288510 ай бұрын

    hey what if there's a quotation mark in the path? Can't figure it out

  • @rymelo2405
    @rymelo24056 ай бұрын

    I'm getting error: Resource at url not found. and as far as I can tell I'm doing exactly the same thing. Any suggestions?

  • @Reza_Audio
    @Reza_Audio2 жыл бұрын

    Hi, do you know why it is not working for some stocks like RETC, INND ,... ?

  • @JustinWaite
    @JustinWaite7 ай бұрын

    Thanks for the video but this doesn't work for me and I've seen other people get the same #N/A Error Resource at URL not found - please help.

  • @Synthetic-cs9ez

    @Synthetic-cs9ez

    2 ай бұрын

    Same here, the Kobe example worked but not the MSFT one. Did you figure it out?

  • @skenderaxe5968
    @skenderaxe59682 жыл бұрын

    Nice! What about the 'Statistics' tab? It doesn't seem to allow me access to the Xpath on, say EV/EBITDA

  • @skenderaxe5968

    @skenderaxe5968

    2 жыл бұрын

    I have a similar issue with the financecharts site

  • @TheReader6
    @TheReader6 Жыл бұрын

    I cant figure out how to get levered cash flow. It doesn't seem to work for me.

  • @erincvarol4888
    @erincvarol4888Ай бұрын

    Hello i dont know if you ever see my message but is seems google has changed something in their settings, the inspec option is not working as one unit but it shows all text so i can not scrape anything lately... am i wrong??

  • @demoix
    @demoix Жыл бұрын

    How to fx an error "Imported Content is Empty"?

  • @Naveen-if8kr
    @Naveen-if8kr9 ай бұрын

    Awesome video with simple steps.. Thanks a lot.

  • @Dividendology

    @Dividendology

    9 ай бұрын

    Most welcome!

  • @neilormelo6069
    @neilormelo6069 Жыл бұрын

    Very good! I tried with reuters site and I didn't get.

  • @user-qy8hl4rx2o
    @user-qy8hl4rx2o Жыл бұрын

    how if website need login ?

  • @shekharb2981
    @shekharb2981 Жыл бұрын

    If I want chart,this method won’t work..what should I do to import stock chart pl inform

  • @tradesbyj7112
    @tradesbyj7112 Жыл бұрын

    can you make something showing how to pull a specific portion of a financial statement. For example, free cash flow. I am trying to pull that from yahoo finance and it keeps giving me an error Resource url not found. I have followed your step by step instructions. Spent countless hours and can't find any help. Can you help? I see that in one of your tables you had the price to free cash flow auto populating so I figured you would now how to at least pull free cash flow. Please help.

  • @user-rn4io5ke1n
    @user-rn4io5ke1n8 ай бұрын

    can we do same web scrapping for prices of articles listed on amazon???

  • @ottomatictrade1579
    @ottomatictrade1579 Жыл бұрын

    Great video, Wondering if anybody got the n/a message and how to fix it…? Thanks.

  • @earbitter
    @earbitter5 ай бұрын

    I'm running into an error. It says "imported content is empty". I've done this two or three times now and it worked for another site, but the yahoo finance site won't let me pull the data. Any thoughts?

  • @itoha3
    @itoha35 ай бұрын

    I tried it. Doesn't work.

  • @globalworldmigrant
    @globalworldmigrant5 ай бұрын

    Tell me, this function works for Facebook, I need to get the number of participants from the list of groups, the name of the group description is the number of participants, it doesn’t work.?

  • @Francisco-Danconia
    @Francisco-Danconia9 ай бұрын

    Do you know why some of these import take ages to load or just never load?

  • @spyxxx566
    @spyxxx5664 ай бұрын

    It didn't work for a Sales Force table I'm trying to connect

  • @jg5479
    @jg5479 Жыл бұрын

    Hey man, really like you videos so keep it up. Also like the other i too am having an error with yahoo. I have been trying to import tables off their site and when i copy paste the site and find the table number it works. However when i delete the url to input the cell where i change the ticker symbol, all of a sudden it shows N/A. I have looked at all your videos on web scrappiing ect. and tried on my own with no success on inputting the cell with the ticker. And also with the xml fuction i am also not able to scape the differnt items from yahoo or other sites. i am on a chrombook but figured that would not matter to much, and also read that it might be a javascript problem but disabled that and tried but nothing seems to work. I am not a code writer so dont know what else to try, so if you are able to find a solution please post another video. Thanks

  • @renegadewolfhound8786

    @renegadewolfhound8786

    Жыл бұрын

    ^This

  • @growthcab
    @growthcab6 ай бұрын

    Does this work with linkedin?

  • @chrisscotthall
    @chrisscotthall10 ай бұрын

    Hello, I've tried using Safari and Firefox to find Full XPath but it's not showing for either browser. Any thoughts on how to find Full XPath?

  • @Squilly4

    @Squilly4

    9 ай бұрын

    In Firefox it just gives you the option for XPath, but thankfully that is the exact same result as choosing Full XPath in Chrome.

  • @woodywood9161
    @woodywood9161 Жыл бұрын

    good stuff! i'm looking for a way to pull option chain data for stocks/indexes that i trade but have been unable to figure out a way....can you help?

  • @Dividendology

    @Dividendology

    Жыл бұрын

    I haven't tried that before. I'll have to look into it.

  • @woodywood9161

    @woodywood9161

    Жыл бұрын

    @@Dividendology any luck figuring this out?

  • @looshenq
    @looshenq Жыл бұрын

    Is webscraping a live function?

  • @jennifertao5885
    @jennifertao58852 жыл бұрын

    When I use the same function, but the cell shows"N/A". Do you have any idea what is the problem with it? Thank you!

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    This may be an error on yahoo finance send as I occasionally run into this.

  • @jtporter89

    @jtporter89

    Жыл бұрын

    @@Dividendology I am having the same issue scraping from any website. Any idea where I may be going wrong? Thank you

  • @listen4159

    @listen4159

    Жыл бұрын

    @@jtporter89 same issue here

  • @avrohomgurevich6951

    @avrohomgurevich6951

    Жыл бұрын

    ​@@DividendologyI couldn't even get the price for Microsoft does this still work

  • @printmohit3600

    @printmohit3600

    5 күн бұрын

    Yes same issue

  • @CrescentCaribou
    @CrescentCaribou10 ай бұрын

    My spreadsheet frequently changes prices that were working previously into #N/A with the message "Error, could not fetch URL: [url]", even before I turned on the auto-update feature. Would you happen to know why this happens, and how to fix it?

  • @Dividendology

    @Dividendology

    10 ай бұрын

    I’m getting ready to post an update! Stay on the look out!!

  • @zimmamania5313
    @zimmamania531310 ай бұрын

    does this update real time? If not do you know how to make it do so?

  • @kyh9229
    @kyh922910 ай бұрын

    Hi I wonder why it doesnt work when i do this with copying the youtube website title? Thank you.

  • @Dividendology

    @Dividendology

    10 ай бұрын

    I’m working on a new update!

  • @toxichelix2340
    @toxichelix234010 ай бұрын

    i cant get it too work

  • @PapeySapote
    @PapeySapote2 жыл бұрын

    Would I be able to use this to add ROIC to your complete valuation model?

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    That could be possible!

  • @PapeySapote

    @PapeySapote

    2 жыл бұрын

    @@Dividendology I’ll try

  • @instalasivideo6506
    @instalasivideo65067 ай бұрын

    Why it can't work on me although i do the same function ? literally same like what happened in this video, on me its always turn out either N/A or ERROR. IDK HWY ARHGGGGG

  • @ProlificSerialCrocheter

    @ProlificSerialCrocheter

    7 ай бұрын

    Same!

  • @JL1009
    @JL10095 ай бұрын

    too bad my triggers don’t work to auto update the sheet :(

  • @user-ov3jb1hr4u
    @user-ov3jb1hr4u8 ай бұрын

    showing an error: Resource at url contents exceeded maximum size.

  • @SC-bi6my
    @SC-bi6my Жыл бұрын

    Its not working..Can you check again?

  • @saraflores338
    @saraflores338 Жыл бұрын

    Also keep getting #N/A :(

  • @stathisgeo7979
    @stathisgeo7979 Жыл бұрын

    Great content. I follow the steps but it keeps say ERROR into the cell. I can't find what i'm doing wrong

  • @Dividendology

    @Dividendology

    Жыл бұрын

    What are you trying to webscrape?

  • @stathisgeo7979

    @stathisgeo7979

    Жыл бұрын

    @@Dividendology just like you i've tried to enter prices fron yahoo finance

  • @Dividendology

    @Dividendology

    Жыл бұрын

    Yahoo finance has been a little finicky lately when it comes to webscraping using importantxml. I’ve noticed some elements not webscraping properly as well. I’m looking into solutions.

  • @stathisgeo7979

    @stathisgeo7979

    Жыл бұрын

    @@Dividendology did you find any solution?

  • @xenonvy8857

    @xenonvy8857

    Жыл бұрын

    @@Dividendology Leaving comment to keep update for solution, having same issues too, appreciate and thanks in advance, subscribed.

  • @Aadyaaaq
    @Aadyaaaq4 ай бұрын

    How to pull list of company names around one building from google sheets

  • @Dividendology

    @Dividendology

    4 ай бұрын

    you can use the tools at Tickerdata.com !

  • @tazulislam2698
    @tazulislam2698 Жыл бұрын

    It is not posible to private website.

  • @jeanphi0078
    @jeanphi00782 жыл бұрын

    Thank you but It seems that it does not work, may be some update from Yahoo finance. In my case I receive: "N/A". Any help from you would be very nive as this function is very powerfull

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    I’ll have to look into this as it has worked for me in the past. Yahoo finance can be finicky at times, so maybe it’ll be a short term problem that gets fixed in the near future.

  • @jeanphi0078

    @jeanphi0078

    2 жыл бұрын

    @@Dividendology yes please if you Can have a look...

  • @mohamedsalam7462
    @mohamedsalam746222 күн бұрын

    I can only find copy XPATH - I cant find copy full xpath

  • @weishin
    @weishin Жыл бұрын

    niceee

  • @cgc2300
    @cgc23005 ай бұрын

    hello I am an Amazon seller, do you think I could retrieve the 2020 history in a Google sheet?

  • @lucatintor4896
    @lucatintor4896 Жыл бұрын

    Error to me

  • @SM-fb4qb
    @SM-fb4qb Жыл бұрын

    this works for US stocks but doesn't seem to work for Indian stocks....

  • @vineethsasidharan5067

    @vineethsasidharan5067

    5 ай бұрын

    Hi, could you figure this out? Did you add ". ns" to the ticker symbol?

  • @OaklynMediaLLC
    @OaklynMediaLLC2 жыл бұрын

    I keep getting #N/A

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    I think that may be an error on yahoo finance’s end.

  • @restindeath1755
    @restindeath1755 Жыл бұрын

    Its not wokring for me, .. maybe bec of the link?

  • @oscar.arroliga
    @oscar.arroliga Жыл бұрын

    Actually, its no a coma "," its a semicolon ";" between of two arguments.

  • @lylestavast7652

    @lylestavast7652

    Жыл бұрын

    might be that you're not using the EN_US locale in your settings for googlesheets so it is rightly different for you. you can look up the locale differences on punctuation etc in the help there.

  • @s-statik
    @s-statik2 жыл бұрын

    Everyone has issues with it but he only replies to positive comments

  • @Dividendology

    @Dividendology

    2 жыл бұрын

    Just trying to make a helpful video!

  • @s-statik

    @s-statik

    2 жыл бұрын

    @@Dividendology I understand that but people clearly have problems with getting it to work so maybe a disclaimer or trying to figure out or maybe fixing what is causing so many problems would be nice.