0

I have created a vba in excel to read a product DKP number and add it to the end of the website URL and it is do it correctly in my vba code. For Example DKP-145686, I input in excel cell and it will add it to the following link: https://www.digikala.com/Product/ The result is : https://www.digikala.com/Product/DKP-145686

In the second step, we need to look at the page with URL address of : https://www.digikala.com/Product/DKP-145686 and scrap the content to see the inventory of this product whether it is available or it is out of stock. The problem is that excel can not open this website correctly since the inventory part of the website is codded by javascript and it can not be loaded by scrap data from web also in the excel Data Tab.

In fact, the problem is happening when we are going to search the specific part in HTML code of the website by class or ID, since the site is not loaded correctly in the Internet Explorer which can not run java script there is no out put from the vba code.

So the question is ??? Is there any way to change the browser in the vba and use google chrome instead of the old Internet Explorer which can not load the javascript at all? or is there any way around this problem to scrap the data after the page loaded completely on the web, since the javascript code needs to be run completely to see the availability of the product on the webpage.

  • 1
    I haven't had much luck with programmatically using browsers besides IE. :( However you should be able to wait for the page to finish loading with `ReadyState`. There are some examples [here](https://stackoverflow.com/questions/23299134/failproof-wait-for-ie-to-load). – ashleedawg Nov 07 '17 at 09:25
  • 1
    Search for "Selenium ChromeDriver" and see examples. – Kostas K. Nov 07 '17 at 09:35
  • Thanks for the comments, the problem is that the page does not load correctly due to the javascript error that happen in IE. – Ehsan Farhangi Nov 07 '17 at 11:30
  • Are you forced to use old IE versions? The website loads correctly in the newest IE. You can handle whether javascript has been executed on this website by checking the element with spinning processing / loading circle continuously. Obviously IE is old, no longer supported and Selenium Chrome is probably the best alternative (faster in tests than Firefox). – Ryszard Jędraszyk Nov 10 '17 at 15:04
  • Where in this page does it actually mention inventory and whether in stock? Seems to be description and price information. – QHarr Jun 10 '18 at 10:33
  • Your code is also missing from this. – QHarr Jul 25 '18 at 19:13

0 Answers0