Excel VBA Introduction Part 47.1 - Browsing to Websites and Scraping a Web Page

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

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

  • @oyeanurag
    @oyeanurag 6 лет назад +12

    You are an amazing teacher. I wanted to get currency rates onto my excel sheet, and you are sent to me by God. You have explained it in exquisite detail. Even a child can follow.

  • @faichieerr
    @faichieerr 6 лет назад

    Waw, i am 30 years old and use youtube for quiet a while; such a helpful video never came across my path. You sir just rock many cheers for your help

  • @lekshey861
    @lekshey861 6 лет назад +2

    Watched many vba videos from other tutors but not so informative, constructive and logical as yours. There is saying in English... knowledge itself is of no value, it's the use of it that makes it valuable, you are simply genius!! kudos !!!

  • @carlos_casio
    @carlos_casio 5 лет назад

    Even though I know a lot about VBA on Excel itself, I never tried Web Scraping before. I started reading some documentation on the Internet about it and tried to automate some few things at my job, but I couldn't quite get the results I wanted, mostly because my lack of knowledge on HTML code and VBA procedures for this. After 30 minutes of this video I accomplished everything I needed without many problems. I finished the video and I'm a fan of yours already. Thank you and I will be watching your other tutorials that I'm sure they're worth it.

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 лет назад

      That's great Carlos! So happy to hear that the video helped you to achieve your aim. Many thanks for watching and for taking the time to leave a comment!

    • @carlos_casio
      @carlos_casio 5 лет назад

      @@WiseOwlTutorials Thank you for your kind answer! I have a question... Is this site possible to Automate? srienlinea.sri.gob.ec/sri-en-linea/#/SriRucWeb/ConsultaRuc/Consultas/consultaRuc
      Because I would like to type a lot of "RUC" Numbers and first of all, is not compatible with Internet Explorer and secondly, I don't see any queries going on, it just loads like the interior part of the window with information. Do you have any video with a webpage alike or somewhere I could read about it? Thank you again!

  • @mShykot
    @mShykot 5 лет назад +1

    IT took almost a week to finish this whole video step by step. Thanks a lot. You clarified everything in a very clear way. Thanks a lot. Thanks for your clear accent and your bright coding sense.

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 лет назад +1

      Thanks, Fahad! Happy to hear that you found the video useful and well done on getting to the end!

  • @evangelinecheng3171
    @evangelinecheng3171 8 лет назад +54

    Just what I needed. You, sir, give the best videos on VBA and are awesome.

  • @MichaelLass
    @MichaelLass 5 лет назад +3

    I have to say, this has been the best video I have watched on scraping. Very well explained.

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 лет назад +1

      Thanks Michael, happy to hear you found it useful and thanks for watching!

  • @maurocastagnera8949
    @maurocastagnera8949 7 лет назад +19

    Andrew Gould = Genius!
    No other words are needed!

  • @paspuggie48
    @paspuggie48 5 лет назад

    This is a brilliant video tutorial ! Concise, explanatory and well presented....well done ! I wish I had found this video 2 years ago when I started self-learning how to scrape websites. I have struggled in all that time...now, I hope to take some of these tips to good use.

    • @paspuggie48
      @paspuggie48 5 лет назад

      @@WiseOwlTutorials if you are not confident, then what does that make me ha ha ! I have used my existing basic skills to create a website auto-login tool. You see, at my work place there are thousands of people who have unique Usernames & Passwords for over 10 different sites they have to log into. This is very very time consuming, not forgetting where they store their personal data. So I developed a tool that automates this process using similar coding. Currently, the estimated savings run into multi-millions, using such a simple approach. I am struggling with some coding problems though, I don't suppose you provide 1-2-1 advice by any chance?

  • @Mekinhumbel
    @Mekinhumbel 6 лет назад +5

    Just an amazing series, crystal-clear explanation, lots of hands-on experience, and perfect pacing--bravo, and thanks for this!

  • @jk501111
    @jk501111 Год назад +1

    I love you WiseOwlTutorials!

  • @gokik9080
    @gokik9080 7 лет назад +1

    I have never encountered any VBA tutorial video of this amazing quality! I was able to follow easily and do what I wanted. Thank you so much for creating this video and I will be learning from you more from now on.

  • @kaistasch4028
    @kaistasch4028 8 лет назад

    Dear Andrew, first of all, thank you very much for the great video. I have got on question: If I click on tag and browse to the next site, how do I activate the new page to be able to click on -tags on the new page? Thank you in advance.

  • @breopardo6691
    @breopardo6691 6 лет назад

    I have been long time dealing with scraping websites. I have learned on my own but this video is awesome because it put all the ideas I had together and perfectly consistent. Thank you a lot for this video, it is extreme helpful.

  • @craisin1
    @craisin1 5 лет назад +1

    You are a great presenter! One of the best I have viewed on the Internet....keep up this great work.

  • @camiel123camiel
    @camiel123camiel 4 года назад +1

    First of all, best explanation I found on the web so far. But although I tested with the same code as you it is not werking.
    At 16:51 I get the following error: Run-time error ‘438’: Object doesn’t support this property of methode. And at 24:42 I get Run-time error ‘91’: Object variable or With Black variable not set.
    Do I need to add any additional reference or is this relaxed to something else?
    Thanks in advance!!

    • @WiseOwlTutorials
      @WiseOwlTutorials  4 года назад

      Hi there, often the problem with things like this is that the design of the website has changed since the video was made, but that doesn't appear to be the issue here. I've downloaded the completed example (you'll find the link for this in the video description) and tested the two examples that you've mentioned and they still work correctly. I'd recommend downloading the completed example and comparing it to the code you've written to see if there are any differences.
      I hope that helps!

    • @camiel123camiel
      @camiel123camiel 4 года назад

      WiseOwlTutorials Hi, thank you VERY much to reply!
      I restarted from 0 to avoid making any typos etc.
      It already bugs at the wait loop (code is 100% the sale as yours at 10:21):
      IE.readyState =

  • @Ali_1
    @Ali_1 Месяц назад

    Hi I have watched many videos on your channel about website automation but I have a question
    I saw someone go to a website and extract data and add data without using Selenium and without using Explorer because it is outdated
    Is it really possible to go to websites using Excel VBA without Selenium?
    Please guide me on how

  • @RicheBleriotKuaguim
    @RicheBleriotKuaguim Год назад +1

    Thank you for the great video. I have a question about an access problem when using XML. Every time I run the code with the Microsoft XML library, I get an access denied error which looks like: execution error '-2147024891 (80070005)'. How can I solve this problem? Thanks again.

  • @smacmcnaron
    @smacmcnaron 7 лет назад

    Wow - this is great material. I've already learned so much and I'm only 1/2 way finished. I am working my own script while I watch. Thank you for putting this together and providing great explanations of the why behind what you are doing.

  • @enzym2004
    @enzym2004 6 лет назад +1

    By far the best video tutorial regarding web scraping with VBA!

  • @masterofnone8443
    @masterofnone8443 6 лет назад

    I have no more words..... how fast and best way to explain

  • @donbogdala5428
    @donbogdala5428 8 лет назад

    Andrew, I'm as happy as a little boy on his birthday with this tutorial! I'm going to have some fun with this code!

  • @haricihan
    @haricihan 4 года назад

    Good formulass thanks for sharing
    I am working on a project to change hotel rates on different webpages but problem is ie.elementsby Id is causing object required issue even if element is there.When i run macro manually with F8, it works fine but its causing that issue when i run it automatic with clicking f5
    Do you have any advise ?
    Thanks for your helps,
    Lovely day,
    Cihan

  • @AbidHasan-m1f
    @AbidHasan-m1f Год назад +1

    Loved your contents, Highly professional and Informative!

  • @govindpreetsingh4329
    @govindpreetsingh4329 5 лет назад

    Dear i sincerely like to appreciate your teaching skills, each video of your is so informative and you have made it simple to understand.

  • @jokerbat11
    @jokerbat11 5 лет назад

    Good Video! I was thinking of loading multiple rows of data from a spreadsheet into an array, then looping through the array to rapidly enter data into a web app (say entering invoices or something repetitive). Once a full record is submitted to the website it may take a variable amount of time for the site to save before I move on to the next record to input. Should I do a "Do While ReadyState..." loop after a record is submitted, not worry about it, or is there something better than a "Do While ReadyState…" loop?

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

    It would be easy to get high grades in college if all professors are like Andrew Gould. He even created Flappy Owl in Excel-a Flappy Bird-inspired game. Although Excel-based games are not entirely a new concept but being able to do that is very impressive..

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

      Thanks! I love the user name!

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

      @@WiseOwlTutorials This is the video that got me into VBA programming and made me understand how this works when I watched this around 2016 or 2017. Prior to this, I really wanted to learn how to do this but I don't know where to start until I found this. So, thank you for doing these videos. I really love your content-Fast-paced, concise, and lots of real world examples; and because you put an extremely high standard in terms of video tutorials, the DOWNSIDE is I can't even watch other tutorials now, other than WiseOwl tutorials, without moving the slider way farther, almost near the end because I want to finish it immediately but with your tutorials my face is fixated near my screen from start to finish because I don't want to miss anything..

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

      @@WiseOwlTutorials I'd like to support you guys in any way I can. So, I'd like to purchase one "Intro to Excel VBA" book. Do you happen to have an e-Book version of it? I know you have a paper back version of it but logistics would be a pain for me because I don't live in the UK, I live in the Philippines..

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

      @@WiseOwlTutorials I hope in the future, you can make C language tutorial using Visual Studio. It's not Microsoft, so if it's not possible, VB.Net using VS would be great, too. I downloaded VS Community but I'm lost, I don't know where to start. I know you have C# with VS, but that's in my bucket list for now..

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

      @@SpaghettiCode5 I'm very happy to hear that the videos have helped you so much and I really appreciate you taking the time to write these comments, thank you so much!

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

    Thank you for this ever so helpful information, perhaps you need to enter an "organised thinking" contest !!!

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

      Thank you Dimitris! I had not heard of an organised thinking contest but I just Googled them and I am now going to waste hours trying to complete the questions!

  • @doyouknowaboutthis6806
    @doyouknowaboutthis6806 6 лет назад

    Best teacher of VBA, thanks for amazing tutorial series.

  • @TheBabarazzi
    @TheBabarazzi 7 лет назад

    Started learning VBA yesterday, so Im really poor. But you did an awesome job!!! Thank you!!

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

    Hi Andrew,
    I love your tutorials. So clear and well prepared.
    However I am struggling with a task I have been asked to perform.
    The web page I need to scrape is from the South Australian Country Fire Services.
    I have to retrieve the fire ban and fire danger rating from provided locations.
    When I inspect the elements, they are all set as tags with no names:
    High
    I need to extract the "High" value of this div.
    This div is nested in 4 other divs:
    1.
    2.
    3.
    4.
    5. Hight -- this is the one I need to extract
    I did not see any references to the div tags and how to manipulate them. Any chance you can help me?
    Thank you

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

      Hi Marc! You have something even better than a name, you have the unique ID of each element. Here's a bit of sample code which will get the fire data rating for Adelaide Metropolitan:
      Private ch As Selenium.ChromeDriver
      Sub GetFireData()
      Dim FbcLevelInfo As Selenium.WebElement
      Set ch = New Selenium.ChromeDriver

      ch.Start
      ch.Get _
      "www.cfs.sa.gov.au/custom/control/fireBan/public.jsp?f_display=day1&f_districtId=1&TB_=true&height=500&width=870"

      Set FbcLevelInfo = ch.FindElementById("fbc_level_info")

      Debug.Print FbcLevelInfo.Text

      End Sub
      I think you'll find this sort of thing much easier using Selenium for VBA which allows you to work with Google Chrome and other browsers. I added a bunch of videos on how to work with Selenium recently, starting with this one:
      ruclips.net/video/FoxWcvZzYVk/видео.html
      And you can find the other videos towards the end of this playlist:
      ruclips.net/p/PLNIs-AWhQzcl3xKvF8sVL4sWRWICj_clM
      Hope it helps!

  • @michaelmoralez8869
    @michaelmoralez8869 5 лет назад

    Thank goodness I found this. I hate doing the charlie work, and this is my saving grace to taking the lazy way out.

  • @RikSail
    @RikSail 7 лет назад

    I am learning a lot from your videos Wise Owl Thank You!!!!You indicate in your video that you can use XML rather than IE if you can arrive at a web page using query strings. Is t also possible to use XML if you must enter PW and USERNAME prior to arriving at the desired page/s?

  • @ElonMuchen3737
    @ElonMuchen3737 6 лет назад

    Mr Andrew, you did a nice work there. Your videos have an invaluable source of information.

  • @nathangreen9239
    @nathangreen9239 7 лет назад

    This is incredibly informative and very well presented. Thank you Andrew Gould for such a great video!

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

    Very clear and simple presentation, thank you!

  • @jorgearias437
    @jorgearias437 4 года назад +1

    Thanks for sharing this. It’s really helpful. Do you know if there’s a way to download a Tableau workbook using this?

  • @chrisschmid9259
    @chrisschmid9259 5 лет назад +1

    Thanks for the video, this is of great help!
    For one of the pages I work with, I encounter the problem, that I have to log on (which runs fine with VBA), then a new screen appears and there is a selection to the left as well as a standard column on top of the page. when running a For Each HTMLA In HTMLAs loop, I can get the hyperlinks of the top of the page, but cannot access them to the left. Do you have any way of helping me? The page seems to be formatted with mostly only hyperlinks, two TR and one table (that covers both the top row as well as the left column). Thanks

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

    Easily the best VBA course on RUclips. Thanks for this. I noticed that the intelliSence for HTMLInput (24:28) doesn't suggest value as a property. When I tried without .Value it gives a runtime error. It's the sort of annoying 'feature' that can waste hours trying to debug !

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

      Thanks! And agreed on the point about IntelliSense. It's caused by declaring the variables using the generic IHTMLElement interface. If we know the type of HTML element the variable will reference we can use the specific class to get more help from the IntelliSense. So, rather than using these variables:
      Dim IE As New SHDocVw.InternetExplorer
      Dim HTMLDoc As MSHTML.HTMLDocument
      Dim HTMLInput As MSHTML.IHTMLElement
      Dim HTMLButtons As MSHTML.IHTMLElementCollection
      Dim HTMLButton As MSHTML.IHTMLElement
      We can use these:
      Dim IE As New SHDocVw.InternetExplorer
      Dim HTMLDoc As MSHTML.HTMLDocument
      Dim HTMLInput As MSHTML.HTMLInputElement
      Dim HTMLButtons As MSHTML.IHTMLElementCollection
      Dim HTMLButton As MSHTML.HTMLButtonElement
      We'll then get more help from the IntelliSense when referencing the Input and the Button objects. Of course, the IHTMLElement interface is still useful as you can't always predict what type of HTML element you're going to encounter, particularly when looping over the children of a parent element.
      Hope that helps!

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

      If you were still interested in Selenium... ruclips.net/video/FoxWcvZzYVk/видео.html

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

      @@WiseOwlTutorials hey thank you 🙏 I thought it was a bit cheeky to ask and I’m still having ago at your xml videos. These are golden. 👍

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

      @@KLiCuk1 😀 it's never cheeky to ask, it was just a happy coincidence that I was preparing the exact thing you were asking for!

  • @elnurshabanov1608
    @elnurshabanov1608 5 лет назад

    Your explanation is superbly detailed!

  • @byteseq
    @byteseq 7 лет назад

    Very detailed and easy to follow tutorial. Top quality!

  • @皮皮-e1e
    @皮皮-e1e 7 лет назад

    U r a life saver! This is the best VBA tutorial that ever had !

  • @MrDeath2118
    @MrDeath2118 4 года назад

    Great tutorial. I would like to know how to get information but with a file saved in my PC that opens with Internet Explorer, it's not a web page. I tried with this method and it is easy in a web page but with a HTML file I get the "automation error". Can you help me?

  • @AnmolKumar-jl3og
    @AnmolKumar-jl3og 3 года назад +1

    Happy Teacher's Day to you sir. You are awesome.

  • @yencheng8095
    @yencheng8095 5 лет назад +1

    Hi Andrew. How can I use Microsoft Edge instead of Internet Explorer ?

  • @prakashrawat2015
    @prakashrawat2015 7 лет назад +3

    You are awesome, I have learned mant things following your videos, they are very very easy to understand,

  • @InventiveMan
    @InventiveMan 4 года назад

    Great tutorial Andrew. I learnt a lot thank you. I have tried these methods but found I can't get them to work on web pages that use javascript to update the page. I was trying to scrape the song Artist & Title from Radio webpages with a 'Player' that streamed content and was updated dynamically with javascript. Unboubtedly my inexperience so any chance of a tutorial to cover that type of page?

  • @tuyoexcelypowerbi
    @tuyoexcelypowerbi 8 лет назад

    Hi,
    After I get www.investing.com/technical/technical-summary and update info selecting checkboxes after clicking on "cutomize" button (all this done with VBA code), it seems that Scraping with IE it takes the refreshed data but this does not happen with MSXML2.XMLHTTP60.
    Do you know why this happen? Do we have to refresh the XMLPage.send or HTMLDoc.body.innerHTML = XMLPage.responseText?
    Thanks for your help and for all fantastic videos.

    • @tuyoexcelypowerbi
      @tuyoexcelypowerbi 8 лет назад

      Many thanks! I will check it but I think that it is going to be too much complicated for me!
      Due to the different ways that sites are created I think Web Scraping is the most difficult technique to learn programming with VBA.
      I have done Web Scraping with other Web pages but investing.com is the most difficult that I have work with

  • @wangzhichao2142
    @wangzhichao2142 8 лет назад

    Thanks Andrew for your great videos, really helpful.
    May I know is it possible to copy/paste data to PeopleSoft from Excel, not by ExceltoCI?
    And is it achievable if there is no PeopleSoft object library?

    • @wangzhichao2142
      @wangzhichao2142 8 лет назад

      Nvm, thanks for your reply all the same. Btw, your videos are really great!

  • @yogeshwarpe
    @yogeshwarpe 5 лет назад

    First of all thank you very much!!! for the in depth knowledge on this section which made our life so easy with doing tedious tasks while working. Secondly we gained helpful knowledge on getting bots deployed at work for us :-)
    You're awesome Sir!!!!

  • @crystalyin184
    @crystalyin184 7 лет назад +1

    Great video! Thank you!
    Just a small question: how can I place 2 tables side by side ?

  • @abhijitmaitra2200
    @abhijitmaitra2200 8 лет назад

    Hi Andrew, The tutorial videos on web scraping is based on Internet Explorer, will it also work on Google Chrome ? Or, we have to program it differently ?

  • @reajenthomas4601
    @reajenthomas4601 8 месяцев назад +1

    You are amazing! WiseOwnTutorial - Thanks for the tutorial

  • @bongraven4221
    @bongraven4221 7 лет назад

    Dear Andrew
    It's such a great video and I learned a lot from it. But I have some issue, Could We click on the Message from Webpage? My macro error once the Massage pop up on WEB page.
    Can we write a code to send "KEY ENTER" into Web??

  • @jimsmyth4348
    @jimsmyth4348 6 лет назад

    Great tutorial, but when using XML method found that it don't retrieve tables controlled by java script. Where as IE method I can create a loop, allowing for extra content to load. is there a way in the XML method where this can be simulated?

  • @abhayjitthind6420
    @abhayjitthind6420 6 лет назад

    Great Tutorial. Proper organisation and perfect execution.

  • @dww527
    @dww527 4 года назад

    Andrew, outstanding video(s). I noticed since this one is three years old, that the HTML file, yours in particular has changed and some of the code does not work the way you wrote it long ago, is there a way for you to include a ./legacy html page that will ensure the scraping html to VB examples continue to work in perpetuity ? I am having the same problem with other authors as well.
    Kudo's to your step by step approach though, very well done and thought out. I know the web page has changed since they do not match when I load a current copy.

  • @PaZaDrawing
    @PaZaDrawing 5 лет назад

    I fetched the data from a url, which includes only plain text , in multiple lines, but when I use this code, it put everything in one cell, without line break, can someone help please to add each line in a cell?
    XMLdoc.body.innerHTML = XMLpage.responseText
    Range("B2").Value = XMLdoc.body.innerHTML

  • @MrChucky1993
    @MrChucky1993 5 лет назад

    nice video :D but i have a question: why do you use a Object and not a Array ? is that because the object have more information to carry and a array can´t handle that ?

  • @32Tracker1
    @32Tracker1 2 года назад

    Hi, I have just started with VBA Scraping. The tutorials you produce are amazingly informative and easy to follow, and at a pace that is easy to keep up with.
    I have tried some of my own coding and i am getting mixed results, some work Some DONT
    I have a problem with one particular VBA Script that i am working on and wondered if you could take a look to see how I have messed it up.... as it Stumps Me.
    Regards
    Paul

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

      Hi Paul! You're welcome to post code here and I can try to offer suggestions. Happy to hear that the videos have helped so far!

  • @bandit7497
    @bandit7497 7 лет назад

    I love your videos. You do a great jon at making things easy to follow. I have two questions that I am hoping you might be able to answer...
    1:Is it possible to combine element collections or have a collection that includes more than one identifier?
    For example, if there was a class with the name "ABC" and another class with the name "XYZ, would it be possible to create a collection that would contain all the "ABC" class elements AND all the "XYZ" class elements?
    2.I definitely prefer the speed of the XML method, but what if I need to submit a username and password to login to a website?
    Can that be done using the XML method or does that require using the Internet Explorer browser?

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

    Since IE is being retired next week, do you plan to create any videos on web scraping using Edge or Chrome? I know you have the videos on web scraping in Edge or Chrome using Selenium but I am not able to download Selenium at work and also even if I could, my understanding is that anyone who wants to run the code that I wrote using Selenium would also have to have it installed.

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

      Hi Morgan! Edge and Chrome don't provide libraries for VBA so a tool like SeleniumBasic is the only way I know of for interacting with these browsers in VBA.

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

      @@WiseOwlTutorials hi and thank you for taking time to reply to me. So I know that you can use shells to load webpages in Edge and Chrome. Does that disable the ability to access the HTML?

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

      @@morganclendennin1283 Hi Morgan. Yes you can use Shell to launch the application but if you want VBA to be able to communicate with it you'll need a library like SeleniumBasic to do so.
      If all you need is the HTML response from the website then you can ignore the browser entirely and just use an XML HTTP request - you can find a couple of videos which talk about this topic in this playlist ruclips.net/p/PLNIs-AWhQzcl3xKvF8sVL4sWRWICj_clM
      Bear in mind that all you'll receive is the HTML response text - if the content that you're after relies on client script processed by a browser then this technique will be no use.
      One alternative option is to use a web query processed by Power Query in Excel. See my reply to luttermc on this post www.wiseowl.co.uk/vba-macros/videos/vba-scrape-websites/web-query-tables/

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

      @@WiseOwlTutorials Unfortunately I don't think that using an XML HTTP request will work for me as the website that I need to pull the data from requires the user to log in before the data can be accessed.

  • @ОлегШенкер-з8ш
    @ОлегШенкер-з8ш 3 года назад

    Hi. Thank you for your introduction to web scrapping. It was extremely helpful in my own project where I have downloaded historical prices and dividends from two different pages and combined them to single query. The only problem I didn't managed to resolve is to how append master table with new pieces of information from additional queries. As excel allow me only to append to queries and save result as a new one I was ought to save new master and delete the old one after checking for accuracy of new information.
    By the way I can share my results somehow to you if you are interested.

  • @d4bridges873
    @d4bridges873 7 лет назад

    Would you be able to help me figure out how to "click" a button. I am using Google maps to search a set of coordinates (say "40, -80" for simplicity) and after searching I want to click the "Add Label" button that appears in the pane. The HTML tags it as a button but when I try to loop and count buttons on the page it doesn't seem to be included (only 3 are counted which I have identified as other buttons). It has no identifiers I can figure out, any help would be greatly appreciated.

  • @kashifkhanspecial
    @kashifkhanspecial 8 лет назад

    Hi Andrew,
    Thank you so much for this knowledgeable video tutorial about scraping a web page through Excel VBA, could you please post a tutorial about, how can we manipulate, extract or put information in “Frames” in a web page, and how can we click on JavaScript button, that is calling a JavaScript function.
    Kindly request to you, please post a video tutorial about above queries that would be really helpful.
    Thanks, once again for this lovely tutorial

  • @MaheshKumar-qb5rg
    @MaheshKumar-qb5rg 5 лет назад +1

    Wow.. what a video, Awesome Sir

  • @youknowme6780
    @youknowme6780 5 лет назад

    Thanks for the video, just need to ask as i have ids under div, then fieldset, and then class. Not able to reach that part to find the element by id and select.... Im not a programmer but tried to follow you... But no success....i can send all the html code to look for...basically after submit on first page it opens another page on same page, that is where i need to select element by id to fill data from excel....see if you can help...

  • @PFCMCS
    @PFCMCS 8 лет назад

    Hi Andrew, great video. If I'm working with a site that uses frames (HTML 4.1), how would I go about looping through each element within a certain frame, with the end result of clicking a hyper link within said frame? Thanks

    • @PFCMCS
      @PFCMCS 8 лет назад

      Worked a treat, thank you

  • @ruaridhmackenzie3215
    @ruaridhmackenzie3215 8 лет назад

    These videos are awesome, I do need help with one thing though, I need to remove the automatically detect settings in LAN settings>Advanced Settings> Internet Options when im accessing a site. Ive looked over the object library and cannot see an option, can you help, please?

  • @data-science-ai
    @data-science-ai 7 лет назад

    Amazing, the teaching style, the content, truly amazing. Thank you.

  • @marcuschick2740
    @marcuschick2740 7 лет назад

    Is there any way of scraping the list of videos in a playlist or in the "Watch Later" page on RUclips?

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

    I came here as newbie looking for how to pull specific data from the internet. This tutorial assumes you already possess a lot of knowledge I certainly do not possess.

  • @johnjenkins1489
    @johnjenkins1489 7 лет назад

    Very useful and clear explanation. Great work

  • @alfredtolaget9101
    @alfredtolaget9101 4 года назад +1

    Thank you so much. I needed this information to help me out on my project.

  • @setukansara
    @setukansara 8 лет назад

    Awesome, we can do exact same thing without spending too much money on QTP/UFT. Thank you so very much. :)
    Eager to watch 48 asap.

  • @navcrewdbs3643
    @navcrewdbs3643 5 лет назад

    Hi Andrew @wiseowltutorials, at 25:40 the code on my PC gives a "Run-time error '91': Object variable or With block variable not set". I don't know how to spot the mistake under the local window for "HTMLDoc" either while stepping through with F8. My code is an exact copy of yours. Curiously, the BrowseToSite subroutine works. Thank you.

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 лет назад

      Hi there, I think this is probably due to the Wise Owl website changing to use https since the video was created. Try changing the code to the following:
      Sub GetHTMLDocument()
      Dim IE As SHDocVw.InternetExplorer
      Dim HTMLDoc As MSHTML.HTMLDocument
      Dim HTMLInput As MSHTML.IHTMLElement
      Dim HTMLButtons As MSHTML.IHTMLElementCollection
      Dim HTMLButton As MSHTML.IHTMLElement
      Set IE = New SHDocVw.InternetExplorer
      IE.Visible = True
      IE.navigate "www.wiseowl.co.uk"
      Do While IE.ReadyState READYSTATE_COMPLETE
      Loop
      Set HTMLDoc = IE.Document
      Set HTMLInput = HTMLDoc.getElementById("what")
      HTMLInput.Value = "Excel VBA"
      Set HTMLButtons = HTMLDoc.getElementsByTagName("button")
      HTMLButtons(0).Click
      End Sub
      I hope that helps!

  • @aceronf
    @aceronf 5 лет назад

    Hello sir. I just happen to watch your video a couples of weeks ago, and try it with some pages here at work but it gives me some kind of error on the Do While readystate_complete. It says “the object invoked has disconnected from its clients”. Do you know what is that ? Than you for the help

  • @edwinmiranda4005
    @edwinmiranda4005 4 года назад

    Hi Andrew, hope you’re doing well during the pandemic. I was just wondering how can we now web scrape without internet explorer since Microsoft said they will shut it down?

    • @WiseOwlTutorials
      @WiseOwlTutorials  4 года назад +1

      Hi, you'll still be able to use IE even when support for it ends but there are other ways to scrape websites. You could use XML HTTP requests as shown here ruclips.net/video/R0xpDLzVcuw/видео.html
      If you still need to open a web page in a browser (to run Javascript code for example) you could try using the Selenium library which allows you to manipulate Chrome using VBA github.com/florentbr/SeleniumBasic
      I hope that helps!

    • @edwinmiranda4005
      @edwinmiranda4005 4 года назад

      WiseOwlTutorials thank you so much!

  • @SebAnt
    @SebAnt 4 года назад

    What a fantastic and useful tutorial. Very well explained step by step. I love it!

  • @JoergB
    @JoergB 6 лет назад

    Very competent explained. For me as a german with medium english know how it is well understandable! THANKS!

  • @mikerousseau4936
    @mikerousseau4936 4 года назад

    The Readystate Complete code works for the initial page load, but not for subsequent page loads. Can it not be used more than once in a sub routine?

  • @charlesabraham7171
    @charlesabraham7171 4 года назад +1

    Excellent tutorial. Thanks

  • @maurocastagnera8949
    @maurocastagnera8949 7 лет назад

    Excuse me Andrew, but when I use the simple sub BrowseToSite, sometimes the internet page does not open in full screen on the pc. Other times it opens, but only the open page icon remains in the taskbar and is not displayed on the screen. How can I make the Internet page open to full screen when I run the macro? Thank you very much, you are the best!

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

    Great Tutorial!!! Just on point!!!

  • @germanduterte7110
    @germanduterte7110 5 лет назад +1

    This was truely amazing demonstration

  • @shakey3258
    @shakey3258 8 лет назад

    Great vid. Would it be possible to get the rates into a Ms Access table?

  • @reyreyes4583
    @reyreyes4583 6 лет назад

    What a great video tutorial! You're a genius!
    I only have one question, sir. What code shall I use if the owner/creator of the site disabled the "button" and will only be activated when you manually type in or paste a value in search bar? Thank you so much!

  • @andrewbreuer9839
    @andrewbreuer9839 4 года назад

    I'm trying to make a program to retrieve data periodically from the website I'm parsing, but the this example outputs whatever was in the HTML the first time I ran the macro even if its changed on the website. I've tried clearing the XMLPage and HTMLDoc at the end of the "BrowseToExchangeRatesWithQueryStringAndXML()" function , but that still doesn't update the HTML received the next time I run the macro. Anyway I can make it reload the HTML?

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

    I hope you are doing well
    I need your help
    When I open web page using my office site it has been load successfully but when I use IE.ReadyState
    It's give me an error like The Remote server machine does not exist or is unavailable.
    Please help me to resolve the issue

  • @wasimdingankar3599
    @wasimdingankar3599 8 лет назад +13

    father for vba excel------------->Andrew Gould
    thank sir

    • @wasimdingankar3599
      @wasimdingankar3599 8 лет назад

      Hello Sir,
      i am trying to capture amazon prices using following code , but it isn't get worked, could u please give me any suggestion or hints for this - thanks
      Sub amazonprices()
      Dim xmlpage As New MSXML2.XMLHTTP60
      Dim htmldoc As New MSHTML.HTMLDocument
      Dim htmltables As MSHTML.IHTMLElementCollection
      Dim htmltable As MSHTML.IHTMLElement
      Dim rowhtml As MSHTML.IHTMLElement
      Dim cellhtml As MSHTML.IHTMLElement
      Dim spanhtml As MSHTML.IHTMLElement
      xmlpage.Open "get", "www.amazon.in/dp/B01LZ8O3JZ?psc=1", False
      xmlpage.send
      htmldoc.body.innerHTML = xmlpage.responseText
      Set htmltables = htmldoc.getElementsByTagName("table")
      For Each htmltable In htmltables
      For Each rowhtml In htmltable.getElementsByTagName("tr")
      For Each cellhtml In htmltable.getElementsByTagName("td")
      For Each spanhtml In htmltable.getElementsByTagName("span")
      Debug.Print spanhtml.innerText
      Next
      Debug.Print cellhtml.innerText
      Next
      Debug.Print rowhtml.innerText
      Next
      Debug.Print htmltable.className
      Next
      End Sub

    • @wasimdingankar3599
      @wasimdingankar3599 8 лет назад

      thank u sir for active response i mean it does not return the results(price of product)

    • @wasimdingankar3599
      @wasimdingankar3599 8 лет назад

      Ur response to our query and other question that really makes you really
      so special. I really like to work our on your suggestion and really
      eager to share outcome - stay blessed and healthy

    • @wasimdingankar3599
      @wasimdingankar3599 8 лет назад

      Hello Sir i worked as per ur suggestion but still not able
      to get desire result could you please help me with below one thanks
      Dim htmldoc As New MSHTML.HTMLDocument
      Dim htmltables As MSHTML.IHTMLElementCollection
      Dim htmltable As MSHTML.IHTMLElement
      Dim rowhtml As MSHTML.IHTMLElement
      Dim cellhtml As MSHTML.IHTMLElement
      Dim spanhtml As MSHTML.IHTMLElement
      xmlpage.Open "get",
      "www.amazon.in/Campus-Sutra-Varsity-Sweatshirt-Pocket/dp/B013HP8XOE/ref=br_asw_pdt-4?pf_rd_m=A1VBAL9TL5WCBF&pf_rd_s=&pf_rd_r=FJFNB5DQH0Z8RA01A1JM&pf_rd_t=36701&pf_rd_p=ee232f31-b795-49ad-895e-336733526c66&pf_rd_i=desktop",
      False
      xmlpage.send
      htmldoc.body.innerHTML = xmlpage.responseText
      Set htmltables = htmldoc.getElementsByTagName("table")
      For Each htmltable In htmltables
      For Each rowhtml In htmltable.getElementsByTagName("tr")
      For Each cellhtml In htmltable.getElementsByTagName("td")
      ' For Each spanhtml In htmltable.getElementsByTagName("span")
      ' Debug.Print spanhtml.innerText
      ' Next
      ' Debug.Print cellhtml.innerText
      Range("a1").Value = cellhtml.innerText
      Next
      ' Debug.Print rowhtml.innerText
      Range("b1").Value = rowhtml.innerText
      Next
      'Debug.Print htmltable.className
      Range("c1").Value = htmltable.innerText
      Next
      End Sub

    • @wasimdingankar3599
      @wasimdingankar3599 8 лет назад +1

      thank us so much sir, ur given sugestion really works may Allah bless u for ur noble work in teaching, if i get a chance to come UK i really like to have handshake with u

  • @MagnusAnand
    @MagnusAnand 7 лет назад

    Hi Andrew, great video!!
    Maybe you can help me out with this problem.
    Using Internet Explorer with the HTML Object Library.
    I have to access a website, I have to input the credentials (user name and password). Then, using different tabs I have to open different links. (The URL is not a string, can't use string & string).
    How can I open a new tab, each one with a different subroutine, calling IE only once?
    I call the HTML Object library in a subroutine and in the same one I enter the web credentials. But I want the code to access each TAB to be in a different subroutine.
    Do you have any idea how to do this?
    THANKS! I enjoy your videos a lot :)

  • @Trolha14
    @Trolha14 5 лет назад

    Awesome tutorial!!!
    Could someone tell me if it’s possible to populate those tables, rows and cells with data?
    How can we do that?

  • @jayjayf9699
    @jayjayf9699 5 лет назад

    Can u use google chrome instead of internet explorer, would u need a different library for that?

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 лет назад

      Hi Jay, Selenium is what you need to manipulate Chrome via VBA codingislove.com/browser-automation-in-excel-selenium/

  • @rdettmam
    @rdettmam 4 года назад +1

    Fantastic Video!!!! You are the best!

  • @sunpengjie4565
    @sunpengjie4565 7 лет назад

    Hi Andrew,Just a quick question.www.google.com.au/#spf=1I just want to use vba to click "Google Search" button.I inspect the element and get the following:I can get the element by its name "btnK" while when I use click method it does not workI find the solution online and use document.forms(0).submit then it works.Could you please explain a little bit for this?In additionn, how to click the "I 'm Feeling Lucky" button on this page?Cheers

  • @haroldmcbroom7807
    @haroldmcbroom7807 7 лет назад

    Thanks.. Great video... was very helpful, will still take me some time to master this concept of Internet Objects, and HTML Classes, two things I'm not familiar with.

  • @pallikishor
    @pallikishor 7 лет назад +2

    Hi Andrew,
    I want to fetch detail from web page, but the thing is I can't directly navigate to that web page, when I enter detail in one web page and submit it opens a new web page and there I would have required detail. How can I achieve this. In short how to give newly opened tab web page as the reference to the html document variable. Thanks.

    • @youknowme6780
      @youknowme6780 5 лет назад

      Grt vdo, but i have the same query as how to work on this type of web page .....let me know if anyone got through this...thanks

    • @youknowme6780
      @youknowme6780 5 лет назад

      Andrew, get video, but as said i m also facing similar issue .... Anything for this be good...

  • @prestondukes4956
    @prestondukes4956 7 лет назад

    Is there any way to manipulate the pop-up settings of the IE object? I am working with a website, and once the form is populate and the "Compute Values" button is clicked, it creates a new pop-up window.
    I don't want the user to have to interact with the pop-up blocker at all. Is there a way to click 'Allow once' or manipulate the 'Options for this site' button? It seems like this is an object of the IE object and the HTML Document object. Alternatively, is there a way to change the IE Privacy settings using VBA?

    • @prestondukes4956
      @prestondukes4956 7 лет назад

      Thank you so much. I searched everywhere and couldn't find anything like that, but I figured you would know where to go. It required a little additional research into Shell objects and the Internet Explorer security zones. From what I've gathered, the routine on the link you provided would only work on Vista systems. In case anyone else had a similar question, I will leave the link that describes the security zones below:
      support.microsoft.com/en-us/help/182569/internet-explorer-security-zones-registry-entries-for-advanced-users

  • @rohithd
    @rohithd 6 лет назад +1

    While using XML Object, i get access denied Error. I tried using the ServerXMLHTTP method, but couldnt work it out. Can you please help me here?
    Thanks for all the good work that u have done in providing us this valuable knowledge.

    • @jawalim1996
      @jawalim1996 6 лет назад +1

      .. i have same error here .. any luck trying to solve it ?
      "While using vba XML Object to scrap a page, i get access denied Error.".

    • @parky55
      @parky55 5 лет назад

      Hi guys
      I just encountered the same problem. However, this issue can easily be fixed by adding a "s" in the URL: httpS://
      Hope that helps.
      Cheers

  • @alexcasha77
    @alexcasha77 6 лет назад

    I am do an automatic web scraping. The values are changing every hour. Is it possible that every hour the automated imported data get recorded on separate cells rather than replacing it?