Web Scraping Data using ClassNames with VBA

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ต.ค. 2024

ความคิดเห็น • 46

  • @mohanpuri3492
    @mohanpuri3492 5 ปีที่แล้ว +1

    Very well explained video on web-scrapping with an easily understandable example. Excellent work.

  • @moonilyas
    @moonilyas 7 ปีที่แล้ว +1

    Hello,
    Sir,
    I found this video very useful!
    Kindly tell me guide us that if we have several pages of this kind of listing, how we get data from second page, third page and so on?
    Hope the answer will be hear from you soon.
    Thanks!!!!!

  • @trigger7151
    @trigger7151 2 ปีที่แล้ว

    Hi Sir
    I am facing a similar query in my Vba code. For eg. in span if i want address of a person, the innertext of span class gives me ‘address’ as the output. But the actual address is after an element

  • @MrRobox11
    @MrRobox11 8 ปีที่แล้ว +2

    Hi Dinesh,
    I have a question. In this video we can scrape data from website but only few results, only shown 10 of 17.
    How can we scrape all search result 17 of 17 (or 14433 of 14433)?
    I mean, all data. If result is on 5 pages, we can get all results, not only shown . The same situation we have in your another video ("Scraping Webpage Tables Data Using VBA") where search result took 5 pages (200 shown of 605). How to scrape 605 of 605?

    • @philaman1972
      @philaman1972 8 ปีที่แล้ว

      My question exactly!

    • @robertl6711
      @robertl6711 6 ปีที่แล้ว

      My question too. :(

  • @notdisclosed2000
    @notdisclosed2000 8 ปีที่แล้ว

    Hi Dinesh,
    I appreciate the work you do. It is exceptionally helpful. I am, however, having some trouble with the code for this module. I have both adapted it for my own purposes as well as applied it directly as is as a test, but neither of which will actually write any data into excel. Do you have any insight into why this might be and what I can do to fix this?
    Thanks

  • @Cosmologist722
    @Cosmologist722 4 ปีที่แล้ว

    EXCELLENT PRESENTATION

  • @scottmathers8985
    @scottmathers8985 8 ปีที่แล้ว

    Thanks for the video. What about if you need to scrape a website without knowing the layout of the site and the specific class name. How do you loop through the classnames to find out if there is one called say 'Result'?

    • @Exceltrainingvideos
      @Exceltrainingvideos  8 ปีที่แล้ว

      Using a loop after the ready-state is reached and search for 'Result' in the IE document. In fact, you can get the complete HTML document into your Excel worksheet.
      Do a search at www.exceltrainingvideos.com

  • @vishnulalraveendrannair7848
    @vishnulalraveendrannair7848 7 ปีที่แล้ว

    Dear Andrew, thanks for this video. You really make our lives so easier.
    I'm an ardent follower of your channel and have learned a lot by just tuning into your channel.
    I see that the video on automating web works wonderfully well. I have tried many websites and found it working without any hassles. However the same code isn't working when I try to implement in my office. I mean these codes don't work for internal websites of my organization. I'm getting automation error(unspecified error)/ disconnection error (the object invoked has disconnected from its clients) when I try to run the same code.
    Is there a special reason or if there is any other way round?

  • @maddinenirajeshbabu3143
    @maddinenirajeshbabu3143 3 ปีที่แล้ว

    Thanks in advance
    I have one doubt if class name changing every time how to take dynamic class name in ie automation

  • @runforurdeath
    @runforurdeath 8 ปีที่แล้ว

    hello sir,
    can we use excel VBA to run SAP also??

  • @eb_reviews
    @eb_reviews 7 ปีที่แล้ว +1

    Hello Sir,
    I am getting an error where the debugger is highlighting
    Set html = ie.document
    can you please help?

  • @satishhurjal5144
    @satishhurjal5144 8 ปีที่แล้ว

    Dinesh Kumar Takyar
    I need your help in deleting blank lines in a cell. As in above video in your excel sheet after extracting data from web you are having blank lines in each cell in the sheet. so can you please suggest me how can i remove the only blank lines in cells.
    Thanks in advance and waiting for your reply.

    • @Exceltrainingvideos
      @Exceltrainingvideos  8 ปีที่แล้ว

      +satish hurjal This link might be useful: www.exceltrainingvideos.com/tag/delete-multiple-blank-rows-between-excel-worksheet-data-using-reverse-for-next-loop/

  • @sohilkhasatiya2984
    @sohilkhasatiya2984 4 ปีที่แล้ว

    I am getting runtime error 462 'the remote server machine dose not exist or is unavailable' at 'Do While ie.readyState READYSTATE_COMPLETE'

    • @Exceltrainingvideos
      @Exceltrainingvideos  4 ปีที่แล้ว

      Most probably many instances of IE are running at the same time.

  • @michaeldalip
    @michaeldalip 7 ปีที่แล้ว

    Very nice, thank you :)

  • @chitreshpratapsingh
    @chitreshpratapsingh 6 ปีที่แล้ว

    Hello sir, getElementsByClassName method is not available in HtmlDocument class. I have checked in view browser window also and if I use it then showing invalid method or property. Please help

    • @Exceltrainingvideos
      @Exceltrainingvideos  6 ปีที่แล้ว

      Check your code or just google to get info about getElementsByClassName.

    • @cre
      @cre 6 ปีที่แล้ว +1

      go into tools>references> then select - microsoft html objects & - Microsoft internet controls

    • @manasareddy888
      @manasareddy888 5 ปีที่แล้ว

      Sir, I am still getting an error of type mismatch on that line. Can you please help

  • @abdullahquhtani8058
    @abdullahquhtani8058 6 ปีที่แล้ว

    I had a small problem with this code. Could you help me on that plz ?

    • @Exceltrainingvideos
      @Exceltrainingvideos  6 ปีที่แล้ว

      Check your code line by line. Or search my website www.exceltrainingvideos.com

    • @abdullahquhtani8058
      @abdullahquhtani8058 6 ปีที่แล้ว

      Dinesh Kumar Takyar I tried all possible ways with no success. Could you send me your email so I send you the code or should I send it to you here. Thank you.

  • @MrSugat11
    @MrSugat11 6 ปีที่แล้ว

    while doing continuos web scraping using ie on webpage ether it timeout from session automatically or session stops doing tasks automatically. Any solution to fix this

    • @Exceltrainingvideos
      @Exceltrainingvideos  6 ปีที่แล้ว

      This happens when the internet connectivity is poor.

    • @Exceltrainingvideos
      @Exceltrainingvideos  6 ปีที่แล้ว

      Sometimes also when you run the macro multiple times without refreshing.

  • @dukestt
    @dukestt 9 ปีที่แล้ว

    Can you do this to a website that has a username and password you must login to first. I could never get past the login.

    • @Exceltrainingvideos
      @Exceltrainingvideos  9 ปีที่แล้ว

      +dukestt Have a look at this link:
      www.exceltrainingvideos.com/how-to-login-automatically-into-website-using-excel-vba/

    • @dukestt
      @dukestt 9 ปีที่แล้ว

      +Dinesh Kumar Takyar Thats great thanks, I have seen this before. The following lines are the problem
      HTMLDoc.all.Email.Value = “dinesh.takyar@gmail.com”
      HTMLDoc.all.passwd.Value = “abc+123”
      I have to use "username" and "password" on my website. It doesnt like the two lines above and I'm not sure what tag or id to use. I have looked around and found nothing that helps.

    • @Exceltrainingvideos
      @Exceltrainingvideos  9 ปีที่แล้ว

      +dukestt You have to use your own ID and password :)

    • @dukestt
      @dukestt 9 ปีที่แล้ว

      Yes, I was. It still wasn't working. I'll work on it a bit more. See what I can come up with.

  • @umrbekmatrasulov4141
    @umrbekmatrasulov4141 3 ปีที่แล้ว

    error occured "user-defined type not defined"

  • @kashifkhanspecial
    @kashifkhanspecial 7 ปีที่แล้ว +1

    Hi Dinesh Kumar Takyar,
    Thank you so much for this lovely knowledgeable video tutorial, though I have one question for you, for wait until to load a page we use below code.
    Do
    DoEvents
    Loop until ie.Readyestate=4
    However my question is, how can we wait until some part of that page refresh on the selection of some combo box value, let me explain I want to scrap this web site uk.investing.com/indices/us-spx-500-historical-data, and when you scroll down, there is a combo box called (Time Frame), and when you will change the value from that combo box, the data below refreshed, my question is what is the code to wait until load a fresh data on that table, so I can scrap updated data as per combo box selection value, I hope you got my point.
    Thank you so much, God bless you.

    • @michaeldalip
      @michaeldalip 7 ปีที่แล้ว

      the below put a 4-second delay on the website - you can increase if you have a slower internet connection.
      Application.Wait Now + TimeValue("00:00:4")