{"id":851,"date":"2021-02-08T18:26:53","date_gmt":"2021-02-08T18:26:53","guid":{"rendered":"http:\/\/99excel.com\/home\/?p=851"},"modified":"2021-05-14T16:07:53","modified_gmt":"2021-05-14T16:07:53","slug":"web-scraping-with-vba-extract-data-from-website-to-excel-automatically-vba-code-99excel-com","status":"publish","type":"post","link":"https:\/\/99excel.com\/home\/web-scraping-with-vba-extract-data-from-website-to-excel-automatically-vba-code-99excel-com\/","title":{"rendered":"Extract data from website to excel automatically VBA Code &#8211; 99Excel.Com"},"content":{"rendered":"\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/Erse5VJBNp0\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe>\n\n\n\n<pre class=\"wp-block-code\"><code>Dim MyWeb As Object, C As Integer\nSet MyWeb = CreateObject(\"InternetExplorer.Application\")\nMyWeb.Visible = False\nMyWeb.navigate (\"https:\/\/www.snapdeal.com\/search?keyword=iphone&amp;santizedKeyword=mobile+phone&amp;sort=rlvncy\")\nDo\nDoEvents\nLoop Until MyWeb.readyState = 4\nOn Error Resume Next\nDim Mypage As HTMLDocument\nSet Mypage = MyWeb.document\nFor C = 0 To 100\nSet MyData = Mypage.getElementsByClassName(\"product-title\").Item(C)\nCells(C + 2, 1).Value = MyData.innerText\nSet MyData = Mypage.getElementsByClassName(\"product-price-row\").Item(C)\nCells(C + 2, 2).Value = MyData.innerText\nCells(C + 3, 2).Select\nMypage.parentWindow.scrollBy 0, 99999\nNext C\nSet MyWeb = Nothing\nMsgBox \"Done\"<\/code><\/pre>\n\n\n\n<h3 class=\"has-white-color has-vivid-red-background-color has-text-color has-background wp-block-heading\">Excel VBA Code for Web Scraping<\/h3>\n\n\n\n<p>Excel is amazing anyway. You are no stranger to Excel. You use it for various purposes. However, you have perhaps not yet explored how to capitalize on its potential for web scraping.<\/p>\n\n\n\n<p>As you know, Excel is a fantastic tool to deal with data in a structured format! Why Excel is great is because it cannot only carry out basic data computations but also perform data collection as well as analysis.<\/p>\n\n\n\n<p>There is always a huge amount of data that needs to be scraped. It is this data that needs to be analyzed for new insights and business strategy. Where Excel comes in handy is that we need to import into Excel in order to analyze it.<\/p>\n\n\n\n<p class=\"has-white-color has-vivid-red-background-color has-text-color has-background\"><strong>When you use Excel as a web scraper tool, what it does is that it saves a lot of time and energy to scrape web data<\/strong> BUT YOU CAN&#8217;T LEARN HOW THEY DID.<\/p>\n\n\n\n<p>So, here i am going to explain how to extract any website data using excel vba code. I have explain the use and run the above code in given video, request you watch it before using code.<\/p>\n\n\n\n<p>Step 1. Watch video<\/p>\n\n\n\n<p>Step 2. Open Excel Sheet and Insert Command button from developer tab<\/p>\n\n\n\n<p>Step 3. Double Click on button and paste (above) code in middle section of VBA click procedure.<\/p>\n\n\n\n<p>Step 4. Select HTML Object and Internet Control Reference Library.<\/p>\n\n\n\n<p>Step 5. Go to in Excel and disable design mode in Developer Tab<\/p>\n\n\n\n<p>Step 6. Click on Button to get Data.<\/p>\n\n\n\n<center>\n<object data=\"https:\/\/99excel.com\/download\/index.html\" width=\"100%\" height=\"5000\"> <\/object>\n<center>\n\n\n\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Excel VBA Code for Web Scraping Excel is amazing anyway. You are no stranger to Excel. You use it for various purposes. However, you have perhaps not yet explored how to capitalize on its potential for web scraping. As you know, Excel is a fantastic tool to deal with data in a structured format! Why &#8230; <a title=\"Extract data from website to excel automatically VBA Code &#8211; 99Excel.Com\" class=\"read-more\" href=\"https:\/\/99excel.com\/home\/web-scraping-with-vba-extract-data-from-website-to-excel-automatically-vba-code-99excel-com\/\" aria-label=\"More on Extract data from website to excel automatically VBA Code &#8211; 99Excel.Com\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-851","post","type-post","status-publish","format-standard","hentry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/comments?post=851"}],"version-history":[{"count":3,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/851\/revisions"}],"predecessor-version":[{"id":860,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/851\/revisions\/860"}],"wp:attachment":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/media?parent=851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/categories?post=851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/tags?post=851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}