webbot icon indicating copy to clipboard operation
webbot copied to clipboard

'WebDriver' object has no attribute 'switch_to_alert'

Open decodar opened this issue 4 years ago • 17 comments

Hi Natesh - I've been using webbot to automate some browser tasks and recently moved my code to a new mac. I am getting an attribute error on the web=Browser() code - the Chrome window launches, but then nothing happens, and I get the attribute error. I think the problem is either with Chrome (so I reinstalled) or in the Selenium code you wrapped (saving me lots of reading and time - thank you!), but wanted to check with you to see if there was a simple solution.

Thanks!

Darrin

decodar avatar Jan 05 '21 22:01 decodar

I'm seeing this error too. Did you ever find any resolution or figure out the cause?

jpreed00 avatar Oct 14 '21 22:10 jpreed00

me too

questjay avatar Oct 17 '21 16:10 questjay

'switch_to_alert'

I'm seeing this error too. Did you ever find any resolution or figure out the cause?

webbot uses selenium on new version of selenium >= "4.0.0" doen't support 'switch_to_alert' and webbot is not upgraded to new selenium so the solution is to undergrade to selenium == "3.141.0" that will work..

questjay avatar Oct 17 '21 16:10 questjay

No resolution - I converted to selenium.

On Oct 17, 2021, at 9:36 AM, Kwest J. Arcade @.***> wrote:

'switch_to_alert'

I'm seeing this error too. Did you ever find any resolution or figure out the cause?

webbot uses selenium on new version of selenium >= "4.0.0" doen't support 'switch_to_alert' and webbot is not upgraded to new selenium so the solution is to undergrade to selenium == "3.141.0" that will work..

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nateshmbhat/webbot/issues/62#issuecomment-945155578, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASLVTV5EDAQ4ODUXHE3TNN3UHL3SXANCNFSM4VWPCL4Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

decodar avatar Oct 17 '21 16:10 decodar

webbot uses selenium on new version of selenium >= "4.0.0" doen't support 'switch_to_alert' and webbot is not upgraded to new selenium so the solution is to undergrade to selenium == "3.141.0" that will work..

Thanks, that made it work for me!

transcental avatar Oct 24 '21 17:10 transcental

it's work

herlandio avatar Oct 24 '21 22:10 herlandio

I have the same issue with webbot and selenium 4.0.0 on a new Mac; but I don't know how to undergrade to selenium 3.141.0. Can you give me some tips?

rpgraham avatar Nov 04 '21 14:11 rpgraham

@rpgraham just pip uninstall selenium to uninstall then pip install selenium==3.141.0 remember you have to uninstall to undergrade.

questjay avatar Nov 04 '21 14:11 questjay

Thanks so much! That took care of it.

rpgraham avatar Nov 04 '21 14:11 rpgraham

Solved in #80 !

Installing webbot again should fix everything!

transcental avatar Nov 05 '21 17:11 transcental

Thanks, it worked for me <3

@rpgraham just pip uninstall selenium to uninstall then pip install selenium==3.141.0 remember you have to uninstall to undergrade.

Pallav2905-py avatar Nov 22 '21 08:11 Pallav2905-py

Thanks a lot! I was already frustrated. This worked!!!

@rpgraham just pip uninstall selenium to uninstall then pip install selenium==3.141.0 remember you have to uninstall to undergrade.

Leberworschd avatar Dec 31 '21 12:12 Leberworschd

@rpgraham just pip uninstall selenium to uninstall then pip install selenium==3.141.0 remember you have to uninstall to undergrade.

Works for me, thanks!

pedrobritobr avatar Mar 01 '22 20:03 pedrobritobr

@rpgraham just pip uninstall selenium to uninstall then pip install selenium==3.141.0 remember you have to uninstall to undergrade.

Thanks!!

Ezema avatar Apr 22 '22 18:04 Ezema

I have the same problem. I followed the uninstall and install commands to undergrade the selenium to 3.141.0, however the error still there. the version of my webbot is 0.34. Any other thing need to take care? Does it also relevant to the chromedriver version? My Chrome and ChromeDriver version are 101

lulucandy-us avatar May 10 '22 19:05 lulucandy-us

In the latest version of selenium (I downloaded it the day before yesterday i.e. June 4, 2022), you can try using this:

alert = driver.switch_to.alert
alert.accept()

Raksh710 avatar Jun 06 '22 15:06 Raksh710

@Raksh710 I am trying this code from webbot import Browser web = Browser() and when I added driver.switch_to.alert it says driver not found

ghost avatar Jun 08 '22 11:06 ghost