0

I wrote a script for logging into a website and downloading customer data in the form of a csv using selenium package for python. Unfortunately the website just recently added a captcha to the login. It wouldn't bother me that much as I could add a part of the code that waits until I solve the captcha, but it takes almost 10 minutes to solve it. I was thinking I could start selenium on the website after logging into it, but I couldn't find a way to connect selenium to an already opened browser. It seems that using selenium is what triggers the captcha in the first place too as logging into the website without is not a problem. I am looking for another framework that preferably has an easy setup, and can automate already opened browsers, thus I can open a browser manually and then run the code. To get to the csv file, there are quite a few menu options and drop down menus I need to click on.

0

Your best bet is probably to use tools which simulate keystrokes and mouse clicks, so that your script is indistinguishable from human physical input. Usually, such a tool also needs "visual recognition" to handle certain situations that arise. I'm not talking about CAPTCHA, which is still too difficult for any automation tools I'm aware of. The point is that such tools would be able to do things Selenium can't, and in your case shouldn't trigger CAPTCHA in the first place, because they would be using the same browser that you use manually.

Kantu looks like it does all this. Note that I have not used it personally. But it seems like it was designed precisely for the kind of automation you are trying to do.

SikuliX follows a similar gameplan, but was designed to automate anything on the desktop, not specifically the browser. (Kantu was originally conceived as a Web automation tool, but it supposedly can be used for the desktop as well.) I also have no experience with this.

There is a related question on Stack Overflow, which may provide another option or two.

What I have used personally is AutoHotkey, which can serve as a kind of a do-it-yourself Sikuli. The "visual recognition" in AutoHotkey is very rudimentary; you have to do a lot of making your own images by cropping screenshots, or testing pixels at specific coordinates. I have to imagine that both Kantu and SikuliX are much, much easier to use, but I felt I should at least include something that I have personal experience with. The only reason I don't have experience with Kantu or SikuliX is that my own automation needs so far have been fairly basic, and I was already using AutoHotkey for hotkeys and other miscellaneous scripting outside the browser.

There is a very rough comparison of the three tools I've mentioned. It's posted on the same site that hosts Kantu, so you can guess it favors Kantu, but the information presented there seems mostly fair.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.