
Originally Posted by
Edgar
You have options.
1. Stick to the built-in Internet Explorer automation.
2. Create a Fedex api key that lets you use their tracking service. Moke posted a link I had already checked, I don't know if you have to pay for this service, but since it requires me to fill a form with phone numbers, address, and all that stuff, I guess it won't be free. APIs that ask for this much information charge money.
3. Use Selenium. Selenium is supposed to be able to automate Chrome, Firefox and other browsers from VBA. It's free. Go check out some tutorials and see if you can make it work. I've tried it and it always throws errors. I suspect the problem has something to do with the browser version. I have not yet set it up because I use Puppeteer and it's just awesome.
4. Using Puppeteer is your 4th option. It requires JavaScript. Here's how I use it. Install NodeJS, which is the runtime that lets you use that library and many more. Install VSCode, which is the text editor where you'll write the code. Install the Puppeteer library. Assuming you already have a working solution that you've been testing, now deploy an executable that is agnostic of NodeJS, for that, I use another library called nexe. One command later and I have an executable. From VBA, call this executable. Make sure your Puppeteer program creates an output file that can be read by VBA. That way the whole architecture looks like this:
VBA calls the executable > The executable automates Chromium, Generates an output and closes itself > VBA reads the output.
I've done this so many times it's very normal for me. Yes, I know, it won't be easy. But you don't have to suffer, ChatGPT can help you tons. You could have a working solution in minutes from now, unlike previous years. Give the tracking API a try, maybe it's free. Or maybe someone offers a third party API that is free. Like Bing, which you can also use, but requires you to setup a VPN because nowadays it does not return the year in the delivery date for US IPs. So here's your 5th option.
5. Configure Internet Explorer to use a VPN, nowadays there are many free VPNs, so you probably can use that to make Bing search believe you're from another country that does make it return good good dates.
Here's a much shorter overview. If you end up using Puppeteer, you'll definitely do this faster, maybe it will take 2 or 3 seconds. If you use Selenium, it's probably the same time. If you stick to IE, yes, it will be a little slower, but it's working, right? you can sip some coffee and boom, done. So, basically, what I'm trying to say is that you'll gain a few seconds by using a modern browser, but are those seconds worth the efforts of learning, say, Puppeteer? or setting up a VPN? or making Selenium work? or potentially paying Fedex? Put these on a scale.