V
V
Vincent2019-05-16 16:25:46
Python
Vincent, 2019-05-16 16:25:46

How to execute js script on a page using Selenium?

Hello, I use Selenium to parse sites, but now I came across the fact that the site administration put a captcha at the input, at first I thought before the parser worked to solve the captcha myself and give it to the script, it worked, only, apparently, due to the fact that the browser is controlled by selenium captcha is 30 times harder to give, which is why I decided to resort to the RuCaptcha service, where in the end I get a token to pass the captcha, but everything is complicated by the fact that the token needs to be sent by running the js script from the console and specify the token in the arguments. So far, I have no idea how to organize it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vincent, 2019-05-16
@wintreist

I found a solution, thanks Dmitry Shitskov , in my last question there was an answer to this, I haven’t tried it yet, but it should work, I use the Driver.execute_script() command
PS: dimonchik2013 Apparently you meant this) Thank you too)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question