Forum

Web Scraping – Fill...
 
Notifications
Clear all

Web Scraping – Filling in Forms

4 Posts
2 Users
0 Reactions
144 Views
(@silverfang)
Posts: 2
New Member
Topic starter
 
Error.PNGI have used SeleniumBasic-2.0.9.0.exe and Latest stable release: ChromeDriver 81.0.4044.69
I'm trying to scrape "Name" data from this website " http://ec.europa.eu/taxation_customs/vies/ ", I chose a Member State from the dropdown, so 'GB-United Kingdom' in this instance. Then enter the VAT Number(Let's say - "

238554836

", and click on Verify.

The issue i'm getting in my code is the

runtime error -2146232576 automation error

in the 5th line of the Code(

While

 Statement)

Sub formfill() Dim Driver As New Selenium.ChromeDriver Dim count As Long Sheets("DATA").Activate Set Driver = CreateObject("Selenium.ChromeDriver") // Here is the Error poping up count = 1 While (Len(Range("A" & Count)) > 0) Driver.Get " http://ec.europa.eu/taxation_customs/vies/" Driver.FindElementById("countryCombobox").SendKeys "GB" Driver.FindElementById("number").SendKeys Range("A" & Count) Driver.FindElementById("submit").Click Range("B" & Count)Driver.FindElementByXPath("//table/tbody/tr[6]/td[2]").Text count = count + 1 Wend Driver.Quit End Sub

Though i have performed all the tasks of installing Selenium , also installed the Chrome Driver too, then the references too in the VBA editor. But other system just cant go past Automation Error.

 
Posted : 15/04/2020 4:49 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Amit,

The code in the workbook and the code in your image are not the same.  I can run the code in the workbook you attached without issue.

As I said in my reply to you on the blog post - in the code in your image, you have not declared or initialized the variable count so when you try to evaluate it in the statement

While (Len(Range("A" & count)) > 0)

You get that error.

Phil

 
Posted : 15/04/2020 5:16 am
(@silverfang)
Posts: 2
New Member
Topic starter
 

Hi Phil,

Sorry the wrong image got attached.
But the code which is perfect ran in one system.
But doesn't run in the other.
It says,  "runtime error -2146232576 automation error" in this "Set Driver = CreateObject("Selenium.ChromeDriver")" line of code.

This is the main issue now.NewError.PNG

Please have a look into this.

Thanks 
Amit

 
Posted : 15/04/2020 12:18 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Amit,

Without being at the PC in question hard to say.  You say the code works on another machine so the issue isn't the code.

Things I'd check:

- Is Chrome installed and working?

- Do the installed versions of Chrome and ChromeDriver match?  Note that as mentioned here https://www.myonlinetraininghub.com/web-scraping-filling-forms they must match

Regards

Phil

 
Posted : 15/04/2020 7:56 pm
Share: