U
U
Us592019-06-05 23:03:47
Parsing
Us59, 2019-06-05 23:03:47

Is Selenium suitable for authorization..?

There is a project in PHP, I used cURL and I wanted to do authorization on one of the large sites, but the problem is that when you go to the authorization page, the site does a lot of things - one of the key ones - it uses javascripts that generate unique links for each login, through cURL I get JS scripts which, as you probably understand, do not generate anything, since the curl does not know how to do this.
What I want to understand for myself:
1) Is Selenium suitable for my task? Can he execute javascripts?
2) How to use Selenium with php? I mean this - There is a code in php:

public function Request ()
    {
// 1 -тут я делаю какие-то задачи...
// 2 -а тут я должен делать запрос к сайту, на котором я должен авторизоваться и вытащить некоторые данные... могу ли я как-то отсюда вызвать функцию чтобы Selenium выполнил какие-то запросы (сделаю отдельную ф-цию допустим).
// 3 - далее эта ф-ция чтобы вернула результат (например вытащить что-то с сайта).
// 4 - вот тут я уже обрабатывал этот результат.
    }

3) Does Selenium just make requests for the urls that we give it? He can't get any specific information? For example json code.. or something else and return it? Then how can this problem be solved? Requests can be ~30+ per minute. (I mean, for example, through cURL, I make a Post request and get the result that is returned and then I process it, but how does this happen in Selenium? as I understand it, it simply returns the task was completed successfully or not, or am I wrong?)
4) What specifically the things I need to install for my task? I am using Ubuntu 18.04 for hosting. Perhaps someone will also advise the php library, as I understand there are several of them .. I want to issue requests through the google chrome browser.
============
I want to say right away that I am a NEW in Selenium, so there are so many questions, maybe someone will seem stupid, sorry right away.
This task can be solved through a lot of other things, I know, but I want to use Selenium, because this is how I see a future prospect for myself, since many sites burn and ban cURL, well, there are many other problems in terms of authorization on large sites . I have basic knowledge of php which is another reason why I don't want to use other languages ​​for parsing.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Yakushenko, 2019-06-05
@kshnkvn

Yes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question