Unable to run the below command

88 Views Asked by At

I am trying to run below object but I am getting an error.

$fr = New-Object -ComObject firefox.Application

I am getting below error.

retrieving the com class factory for component with clsid

But I successed with below command

$fr = New-Object -ComObject InternetExplorer.Application
3

There are 3 best solutions below

0
On

Firefox doesn't expose a COM object like Internet Explorer does. You can't automate Firefox (Chrome, Opera, any browser other than IE) that way.

0
On

To add to the solution, if you want to automate Firefox you need to use something like Watin. It is not supported out of the box.

Check this SO question for details: Automating Firefox and Chrome browsers

You can find Watin here: Official Watin Site

1
On

a = int(input("Please enter the price of onion = "))

if (a<=10): print("Bring 5kg")

else (20>=a<=11): print("bring 2kg")

print("Don't buy come back to home")