I want to write a perl script to auto login a website and do some interesting things. The problem is that the website which I want to log into has a captcha image. I don't have the ability to anticaptcha it, so I need to read the image then display the image to the user to let the user reads the characters on the image, then type the character in the command line back to the program. I want to know, what is the easiest way to display an image to the user?
Thanks.
Firstly you can use LWP::Simple to fetch the image and save it to disk.
Afterwards , the simplest thing on Windows is to do
system("C:\\imagepath\\foo.jpg");
which will show the image in the default application that is used to display it.
On OS X you can do
system("open ~/imagepath/foo.jpg");
On freedesktop.org standard compliant systems you can do
system("xdg-open ~/imagepath/foo.jpg");
These involve switching between a command line app and the OS designated application to view the image. If you want it more seamless you can use a Perl GUI library and create a window with downloaded image
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With