Excel VBA Pull Data From A Website

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 265

  • @scottkirkwood3465
    @scottkirkwood3465 8 років тому +10

    Holy cow...that is literally THE most beneficial thing I've learned with regard to VBA. Been working with it for 10 years now, and I just recently came across a need to interact with an HTML page. So, back to Google, which led me here...and now, the world is again, full of endless possibilities!!!

    • @dp74durre
      @dp74durre 8 років тому

      "the world is again, full of endless possibilities". So the world was once full of endless possibilities, then at some point those endless possibilities ended, and now that you have seen this video, the possibilities are endless, until of course they end. You really should put some thought into the words you string together.

    • @scottkirkwood3465
      @scottkirkwood3465 8 років тому +8

      Why all the negativity? Was there a purpose to that?

    • @dp74durre
      @dp74durre 8 років тому

      Attempting to educate you on the English language.

    • @stevenm8970
      @stevenm8970 7 років тому +5

      you are an idiot, david

    • @kevinmoehring8259
      @kevinmoehring8259 5 років тому

      @@dp74durre Your second sentence wasn't a sentence. It was a fragment. There shouldn't be a period. If you're going to troll someone's use of language, try getting it right yourself. Plus this video was about code; nobody watching this video cares about the finer points of the phonetics found within the English language.

  • @guitardweep13
    @guitardweep13 11 років тому +1

    You're the man! I've just started working as a data analyst, and my boss wants us to stay in excel and vba for prototyping, but his web scraper is messy and complicated as hell; your whole method is concise and well thought out. Props!

  • @ja3sk3adik55
    @ja3sk3adik55 5 років тому +1

    I have moved from a few jobs for the last decade. I was here when you have just uploaded this video, but I always come back and refer back to it. Everyone thinks I'm a genius, thanks to you. Hehe. :P

  • @Exceltrainingvideos
    @Exceltrainingvideos 12 років тому +16

    One of my students gave me the link to your video. Excellent stuff. Thank you!

  • @osareafallire
    @osareafallire 4 роки тому

    I spent all Friday afternoon trying to figure out how to do this and apparently forgot that I watched this video at some point. Soooooooooooo perfect!!

  • @Tussengassed
    @Tussengassed 6 років тому

    This is probably the clearest tutorial within 10 minutes i've seen in a loooong time!

  • @MarinosGo
    @MarinosGo 12 років тому

    7:10 "...and that is how you pull information in an Excell Spreadsheet from a website"
    Thanx for watching
    THANK YOU MY FRIEND i am learning VBA the last month because i want to do Web Scraping and it feels like pulling freakin' teeth
    A Great Help indeed

  • @kennethvela2784
    @kennethvela2784 5 років тому

    Your video is the best so far in scraping data into Excel. It's a perfect video with the perfect explanation. Maybe you can do a video where you scarp data from numerous websites in one spreadsheet

  • @OriginalJoseyWales
    @OriginalJoseyWales 11 років тому

    Man that is an AWESOME tutorial !!! This will be so useful for me at work. I work in education and we often have to get information from governemt websites. I usually have to do it manually but this is so useful. Much appreciated.

  • @vivekvenkatram2038
    @vivekvenkatram2038 10 років тому +1

    amazing man...!!! how could u wrap the whole thing in 7+ min... superb.... great job... you are an extreme talent. Best wishes.

  • @mybibusiness2560
    @mybibusiness2560 6 років тому

    Well done DonFretBrett, this is a great explanation of the power of IE & HTML objects in VBA. Thank you very much.

  • @lokelly2842
    @lokelly2842 7 років тому

    I hope you may able to help as you are the Excel Guru!!!
    Now, my situation is I have the excel list, which is contains the company name, I want to create the query from web search to wrap the company contact.
    The company name will be excel sheet column "A" and paste the contact data in column "B".

  • @zilchsr
    @zilchsr 9 років тому +1

    Great video. A great augmentation would be to have included an error handling subroutine for invalid Zip Codes, for which Excel will throw a runtime error. Here would be my recommendation:
    On Error GoTo ErrorHandling ' add this line before assigning a value to variable sDD
    sDD = Trim(Doc.getElementsByClassName("std-address")(0).innerText)
    On Error GoTo 0 ' add this line after sDD has a value
    '.
    '. (the rest of the code)
    '.
    End If
    Exit Sub ' add this to prevent unwanted execution of subsequent subroutine
    ' add the following lines to the very end of the code
    ErrorHandling:
    MsgBox "Zip Code is INVALID", , "Bad Zip Code"
    Exit Sub
    End Sub

  • @ashley-tg6eh
    @ashley-tg6eh 9 років тому +1

    This is a great video! You taught me a bunch of stuff I didn't even know to ask for.

  • @nabilanaorin6811
    @nabilanaorin6811 8 років тому

    it's amazing that it can be done using vba

  • @alexclark319
    @alexclark319 7 років тому

    I dont know if you are still replying to comments on this video but it is one of the most helpful and well explained tutorials i have ever watched on any subject. Thank you! I now am using it on much more complex websites and have run into an issue where my desired information is not under its buried in then then

  • @hasanmougharbel8030
    @hasanmougharbel8030 2 роки тому

    Hey there, god bless your efforts.
    I am still learning about sql by my own and having today a simple question.
    I learned that Processes (also known as “procedures”) may take values and give
    out parameters.
    Are processes opposite of a function?
    Is there any related functions used to execute a process? Thanks..

  • @danschwindenhammer2812
    @danschwindenhammer2812 12 років тому

    I would really like to see a tutorial such as putting a Stock Symbol in a cell to lookup the stock price off of yahoo.com. Also awesome tutorial, helped a bunch!

  • @robertkomarek8615
    @robertkomarek8615 5 років тому

    Your VBA Editor looks quite nice. What kind of settings and font do u use? Nice tutorial by the was - very good explained!

  • @AaronKabasobokwe
    @AaronKabasobokwe 10 років тому +3

    Hi,thanks for sharing!
    Quick question, What if the data you require is nested within div tags after dd tags?

  • @chinuchfiles1482
    @chinuchfiles1482 6 років тому

    you are awesome! never saw such a crystalized tutorial you are absolutelt amazing!

  • @DontFretBrett
    @DontFretBrett  12 років тому +2

    Thanks! What tutorial should I do next?

    • @zohan1ify
      @zohan1ify 3 роки тому

      hey can i know your linkedin id?

  • @bunrithheng4783
    @bunrithheng4783 10 років тому

    Thank you so much, I've been desperately looking for this kind of tutorial for weeks. Thank you!!

  • @brucew6343
    @brucew6343 11 років тому

    i only stumbled upon this video by chance but I'm glad I did. Good tutorial, thank you

  • @Pgordons
    @Pgordons 8 років тому +2

    Could you do the same thing but this time extracting a specific stock quote from yahoo finance's website? I can't really understand which part of the html code I need for the macro...

  • @IqraZz
    @IqraZz 12 років тому

    This is awesome stuff. What if I want it's a product page on a retail site, in which the URL contains the unique product ID. I would want to for example, insert a URL or an item number into the excel sheet, and then want it to pull the regular price and sale price of the item showing on the product page?

  • @tylerjohnmartinez
    @tylerjohnmartinez 12 років тому

    hey brett, lets say i wanted to pull data for a list of 100 zipcodes, do you have any suggestions for how to populate county city state if i want to input more than 1 zipcode at a time? thanks for the help! great video!

  • @SunSstha
    @SunSstha 9 років тому +2

    The code works perfectly, thanks.
    I was wondering, how can the code be applied to the columns right to the B column? I mean how can the coding be changed so that zip code entered in C1, D1 or so forth would give the results in their respective columns?

  • @ishouldbeNthekitchen
    @ishouldbeNthekitchen 12 років тому

    Holy shit, I thought I was pretty good with Excel until now! Great info.

  • @rlbrook1
    @rlbrook1 5 років тому +6

    Hi DontFretBrett
    Awesome code! I love the way it works exactly for what I need! Is there a way to get it to work Google Chrome instead of IE?

    • @amitshah1922
      @amitshah1922 4 роки тому

      You can achieve that with Selenium and VBA combo which will let you use Chrome,IE,Firefox,Opera,Mozilla too.
      It classified as a automation tool that facilitates scraping of information from the HTML web pages to perform web scraping utilizing google Chrome and etc.

  • @lordterrin
    @lordterrin 9 років тому

    Absolutely wonderful video. Thanks man!

  • @SSS-hm4pw
    @SSS-hm4pw 5 років тому

    Excellent code. So cool.Thanks.

  • @keashanjayaweera
    @keashanjayaweera 10 років тому +1

    Thank You. I was tired before googling this

  • @diegoduarte4563
    @diegoduarte4563 5 років тому +1

    Thank you very much, this explanation was tremendous helpful to me.

  • @1marc1967
    @1marc1967 12 років тому

    Great video, very useful, you are a very good teacher. I have a question, i need to do the reverse of your video-take data from excel and input that on a webpage. Such as on a webpage signup you need to enter name address phone number...Is that possible?

  • @loquitodan
    @loquitodan 7 років тому +1

    I learned a lot from your tutorial, thanks!

  • @andreisweet7642
    @andreisweet7642 9 років тому +2

    You sir are brilliant!

  • @imutumpai
    @imutumpai 9 років тому

    Great knowledge & your help is really appreciable!! I like your speed of typing the code also

  • @lukster79
    @lukster79 13 років тому

    Great tutorial. Could you run this on multiple zip code lines though? Sorry perhaps it's a basic question but I have no experience in visual basic.

  • @ubellubo
    @ubellubo 11 років тому

    Excellent video. Just what I needed to learn next. Cheers.

  • @me2this1
    @me2this1 12 років тому

    Thank you very much for the small and nice tutorial. It was much helpful.

  • @rafaelmasilang6490
    @rafaelmasilang6490 10 років тому

    First of all, this is EXTREMELY helpful, but what if the website needs you to log in first before you can look up data? Will it still work if I just make sure I'm already logged in before I run the code?

  • @razandy
    @razandy 12 років тому

    You know its just crazy how you come across stuff. I have been looking for an alternative solution to Excel Web Quires to get info in from eBay and have been really, really struggling. I had given up and somehow I can across you video. You are amazing I thought I was good on Excel VBA but you make me look like a beginner! Will this work with Username/Password websites like eBay? Have you any experience with eBay tables (Sold Listings-Active Listing) and is it possible to use eBay API in Excel.

  • @stealthwolf1
    @stealthwolf1 12 років тому

    You sir are amazing. If I wanted to loop the search down a column and input the data across the row of the source cell in the column how would I do that?

  • @jamesbailey7299
    @jamesbailey7299 10 років тому

    That was very interesting. I am a computer tech and have been setting up a company with pc's. They asked me if I could pull phone numbers from the internet and I have spent days trying to find something. Is that possible and how long would it take me to learn VB and excel or what would you charge to create it for me. thank you for taking the time to teach us.

  • @megam0n941
    @megam0n941 4 роки тому

    The part where you altered the url with the text box name (3:10 minute mark). What search words can I use to research it further? Trying to figure out how to fill check boxes and control a tabindex.

  • @ignacioa3698
    @ignacioa3698 4 роки тому

    I know you can pull data like say, income statements rows and columns for financial analysis.
    How bout for pulling that same data when the data is in an imbedded pdf forms where you cannot open up the actual pdf that’s posted on the webpage, but all you can do is scroll left and right within the pdf. That format is popular in financial sites currently.

  • @manim1840
    @manim1840 2 роки тому

    Excellent sir, this vedio... same like that i need for delivery status from the website, How i will get the use consignment no. to get the status...

  • @dmr450
    @dmr450 11 років тому

    Great tutorial. Very clear and precise.
    Thanks!

  • @ahrorkuldashev9603
    @ahrorkuldashev9603 4 роки тому

    Great video! Could you also create a similar video about downloading files from websites. Say, you enter a date range and download a excel file with transactions within the given date range.

  • @solilogram
    @solilogram 12 років тому

    Great informative and applicable video - I wonder if it's possible to apply what we've learnt from this video to other websites like Amazon? I realize when using Inspect Element on the first search result of Amazon (eg. Catcher in the rye) I get a bunch of nested DIVs and I have no idea how to access the one I want, in this case the A that contains the title "The Catcher in the Rye" under the H3 tag. In your video, because DD is just under the Body tag, there's no such problem. any idea?

  • @GameCasters
    @GameCasters 11 років тому

    loved your video, it was very insightful but my question is, can this be done with open office? libre office?.. and do you know if this can also be done with Microsoft excel 2003 and 2007? thank you! subscribed!

  • @dividendwatcher
    @dividendwatcher 12 років тому

    simply brilliant, good job

  • @lilin8929
    @lilin8929 8 років тому

    Hi, thanks for the great video tutorial. I am trying out a similar website based on your tutorial.
    I have a question: what if the website that I am extracting the information from requires an account to login? How do I use VBA to log into an account first then extract information.
    Would appreciate if can provide some advise to this:))))

  • @clyburn209
    @clyburn209 6 років тому

    What if zipCode, County, and State are column headers, and each row has a different zipCode, can I use this VBA to load up the data for each row?

  • @pursarth
    @pursarth 12 років тому

    Hi Brett, thanks for posting this video. I am able to fire up IE and the MsgBox. However, I am having trouble with the getElementsByName part. Every time I run it, I get a "Run-time error '91': Object variable or With block variable not set" error. What am I missing? Thanks again for the video - learnt a lot!

  • @allabout1135
    @allabout1135 6 років тому

    What the knowledge...... man You are VBA God. Thanks!

  • @anthonysarno321
    @anthonysarno321 12 років тому

    Great tutorial, I feel like I am understanding more now. However, I have a scenario where I have a url that is modified by about 6 cells that change its destination. The result is an xml, csv, or json output that I would like to extract data from. I've tried many different ways with no results to extract the data. Maybe if I email it, you could help me.

  • @aryesegal1988
    @aryesegal1988 12 років тому

    THANKS A TON!!! I simply can't thank you enough, that was great, looked for such a tutorial for a long time :] thank you once again, keep 'em coming PLEASE..! :)

  • @danielgpratidya
    @danielgpratidya 10 років тому

    trully an expert in explaining through video, Thanks a lot :)

  • @tanawatkrubb
    @tanawatkrubb 8 років тому

    YOU ARE GENIUS

  • @ritzheist
    @ritzheist 5 років тому

    Hello! Can you help me on this? This is regarding stock trading. If a cell value is 'sell or buy' then it should automatically record the stock's (live current price). And after a while when 'sell or buy' disappears (cell value is empty) it records the changed current price into another cell beside previous record. I am already taking live feeds from google finance. For example suppose the price keeps changing over a period of time, lets say (cell A1) value is Sell/Buy and the price (Cell B1) is 235, so it records 235 and put it in cell C1. After some time if A1 is empty and B1 value is 200, then it should paste 200 in D1. That means we will have two price C1=235 and D1=200. It should be automated and NO BUTTONS TO CLICK via macro. Is it possible?
    Thanks!

  • @sureshkumars5474
    @sureshkumars5474 6 років тому

    Thanks for this very helpful video.

  • @lucaslemosfranco2413
    @lucaslemosfranco2413 3 роки тому

    Excellent!!

  • @welcometothewasteland
    @welcometothewasteland 11 років тому

    Well done, excellent tutorial

  • @replife1333
    @replife1333 7 років тому

    This DD stuff is annoying. You've said dd so many times, but this video helped me regardless kinda. Except you didn't talk about how to populate the fields in the page, just took the easy way out since they place nice with their url,

  • @mannix34
    @mannix34 2 роки тому

    Awesome!

  • @DominicPowell92
    @DominicPowell92 7 років тому

    This was very helpful, thank you!

  • @TheAybab
    @TheAybab 8 років тому

    I keep getting "Compile Error: Sub or Function not defined" with my version. What could be causing this? Thanks!

  • @RFMaroja
    @RFMaroja 7 років тому

    Very helpful, solved my problem!!!!!

  • @jeanli3584
    @jeanli3584 12 років тому

    Hi Brett,
    Thank you so much for sharing this video and that is great.
    I’m working on importing data from web (company intranet) to Excel using vba. The web is made of javascript so there are a lot NOBR tags, such as:
    NOBR 6/8/2012 /NOBR BR /DIV
    onMouseOver="mouseOver('I4418', 'Net Deposits …
    6/8/2012 and Net Deposits is what I need to extract.
    Is there MS Java object library that I can reference to? Or how can I import data from this web to excel
    Thanks for your help in advance

  • @jmayache
    @jmayache 9 років тому

    Great tutorial, thank you for your contribution. I am trying to pull data from Yahoo finance based on Rows values (i.e Symbol Values). I was able to get what I need based on your Tutorial for one row (i.e one Symbol). How can I accomplish the same for multiple rows (i.e different symbols)? Resulting values are displayed in the column adjacent to the Symbol Column

  • @iamravikc
    @iamravikc 13 років тому

    Excellent

  • @wessamnasser8693
    @wessamnasser8693 10 років тому

    Fantastic Tutorial!

  • @-simon-3442
    @-simon-3442 4 роки тому

    Sweet thank you so much bro

  • @Jeevaji14
    @Jeevaji14 5 років тому

    Super bro

  • @johnnylingwood
    @johnnylingwood 10 років тому

    Great tutorial! Wondering how would you do this when getting data from a table? I have a webpage with a table of information (ticket name, number of tickets etc) and i want to take the data from that table and put it into excel. any help would be great :)

    • @RoryOConnorroc
      @RoryOConnorroc 10 років тому

      Placements going well so then Johnny? :P

    • @johnnylingwood
      @johnnylingwood 10 років тому

      Rory O'Connor yeah doing a cool project at the moment but struggling a small bit with pulling data :(

  • @hellmutmatheus2626
    @hellmutmatheus2626 8 років тому +1

    dude you rock

  • @DevilHackWorld
    @DevilHackWorld 12 років тому

    Hi, i love your tutorial.
    Thank you so much...!!!

  • @93969pradeep
    @93969pradeep 12 років тому

    Thanks for this great vedio
    Can you please let me know how to get suggestions for properties(ie document)? even after pressing ctrl+space nothing comes up(like getElement properties)

  • @faresar
    @faresar 11 років тому

    now i wanna learn VBA!

  • @gauravkhiwasara
    @gauravkhiwasara 6 років тому

    Thanks for this video.
    Its very helpful

  • @timwu-CMC-599T
    @timwu-CMC-599T 5 років тому +4

    I would use:
    If Target.address = Range("zipCode").address Then
    ...
    End If

  • @ringh93
    @ringh93 8 років тому

    @DontFretBrett
    How do I code If I want to pull data from a website containting:
    Url, Name, email. phonenumber From say 3000 companies on that website but it should all be automated.
    So the program should go through each page and only choose companies having those things?

  • @diegolozano2397
    @diegolozano2397 5 років тому

    awsome video, thank you sooo much.

  • @alanlehmann3624
    @alanlehmann3624 6 років тому

    What if you had two text boxes, how can you combine the two in the URL....for example: ?place=95818 works for the ZIP, what if there was a box for State and ?state= California also worked. How could I put the two together into one single URL? I have a webpage like that and I've tried everything & & %26.....or is each webpage different?
    Love this video!

  • @evildiablo19
    @evildiablo19 11 років тому

    Very nice, thanks for uploading

  • @shlerTHEnumbas
    @shlerTHEnumbas 10 років тому +2

    Will you make another video like this for a different website? It would be great if you could explain how to fill in information in the forms of the website. That is what I am struggling with most. I cant seem to click the damn buttons LOL. Thanks again for teaching us!!

    • @chrisklest1238
      @chrisklest1238 6 років тому

      I have a script that logs me into a website, but once I'm inside I cannot seem to navigate inside the website.

    • @Raindeux
      @Raindeux 6 років тому

      Idk if VBA has the capabilities to do that, but VB itself can click anywhere on the screen you tell it to and perform key clicks. This can be further automated by looking for keywords in the html before determining what to type in to each available text box. Very useful for spam submitting resumes for computer engineering jobs lol.

  • @Yuvastanza
    @Yuvastanza 8 років тому

    Funtastic and searching for this crawler video :D. Thanks +DontFretBrett

  • @dondon1
    @dondon1 7 років тому

    Thank you DontFretBrett! This is very helpful. :)

  • @eggubonda
    @eggubonda 12 років тому

    Nice one. Thanks a lot.

  • @Creative-Engineering
    @Creative-Engineering 11 років тому

    Great video!Your tutorials are easy to understand.
    I'm trying to import stocks fundamentals from uk.advfn website
    as well as create charts from price histories from yahoo finance
    I can do this already,however i would like to do this using a simple drop down menu in excel so i do not have to create a new excel sheet for every company i wish to look at.I have an example on my computer (which i can email you if you like).Thanks

  • @lalu225
    @lalu225 11 років тому

    very nice. pure ownage. you are good!

  • @completelystupid87
    @completelystupid87 8 років тому

    I'm trying to apply this example to get the price on Amazon but it's not working, could you please make a tutorial for it please ?

  • @mp1158
    @mp1158 11 років тому

    Can you do one, where you have a secure website and need to login? Also how should you address the problem if your search returns several lists/links that you need to go to in order to get the necessary data?

  • @ObsessiveVolunteer
    @ObsessiveVolunteer 12 років тому

    Your video is amazing, thank you. I'm trying to replicate it to extract prices from a table without a search. I'd like to limit the field by 1-2 seller's price, whose field name is "div class="num" instead of "dd." Before I simply extracted data from Excel's "get external data > from web" but this seems faster & narrower for numerous entries. Do you help people on VBAs like on Fiverr?

  • @jayjayf9699
    @jayjayf9699 5 років тому

    Aren’t u supposed to use square brackets for indexing ?

  • @twinspierre-louis2346
    @twinspierre-louis2346 4 роки тому

    Good day.
    I tried completing this task, but I kept getting the type mismatch error message for the line IE.navigate. Can this error be corrected? Please advise.

  • @easyearning6682
    @easyearning6682 4 роки тому

    this the awesome video

  • @MrEduardoToscano2
    @MrEduardoToscano2 6 років тому +2

    Hi Can I do this with USPS tracking system?

    • @DPaquette
      @DPaquette 5 років тому

      yes of course you can.