Hi all
Can anyone please help with providing code that would allow me to:
1. Send each of the numbers in column A of the attached spreadsheet (and indeed any amount of numbers included in column A) ie:-
238554836
166913834
205963701
343475355
220430231
to http://ec.europa.eu/taxation_customs/vies/
2. Select GB-United Kingdom on the top down menu
3. Enter each of the numbers in turn into the VAT number box below the above drop down
4. Return the name of the relevant business back to the spreadsheet in column B next to the original VAT number
Any help would be much appreciated?
Thanks
Dave
Hi Dave,
I think I can do this but it will take some time to code + test.
I'll try to get back to you tomorrow.
Regards
Phil
Hi Phil
If you can figure it out you will be an absolute legend!
Thanks
Dave
Hi Phil
Any joy with this - I'm guessing it's proved harder than you first thought? 🙂
Thanks
Dave
Sorry Dave, I am having intermittent success with the code.
The problem I'm having is that once the results page is loaded and I tell the VBA to grab the HTML page contents, it returns the first page where you enter the VAT number.
Sometimes it gets the correct page, but most of the time it does not. I can't figure out why.
I'm going to try a different approach and see if I have success with that.
Cheers
Phil
Hi Phil
Thanks for the update. The worst kind of coding issues for me are when it sometimes returns the right result - I would rather it didn't work at all than did that as it makes it so frustrating. I really appreciate your efforts - good luck with the different approach!
Thanks
Dave
Hi Dave,
Sorry for the long delay. This was partly due to other commitments but partly due to getting this to work. I gave up on using IE.
The attached workbook contains code that will do as you want. It requires installation of the SeleniumBasic VBA wrapper https://github.com/florentbr/SeleniumBasic/releases and you will need to download and install the latest Chrome driver https://sites.google.com/a/chromium.org/chromedriver/
Copy the Chrome driver to the Selenium installation folder which on my PC is C:UserspgtAppDataLocalSeleniumBasic. This will copy over the driver that came with the SeleniumBasic install.
Selenium is software that allows you to automate a browser. I used Chrome, and the Chrome driver is the software link between Selenium and the Chrome browser. So you will need to install Chrome if you haven't got it already.
The code will loop through a list of numbers in Col A until it reaches the last one.
I'm about to write a blog post to elaborate on the process behind all of this.
Regards
Phil
Thanks Phil - that works perfectly 🙂 The code is pretty simple once you know how to actually do it, but I'd never have figured that out myself, so really appreciate your help. Please could you let me know when your blog post is up, as I would be interested to have a read?
Hi Dave,
Here's the post
https://www.myonlinetraininghub.com/web-scraping-filling-forms
Regards
Phil