I
I
isaac-212020-12-23 18:37:15
Parsing
isaac-21, 2020-12-23 18:37:15

Is it possible to parse data, not through selenium?

Please tell me, here is the site, you need to parse this (rating) from it, is it possible to parse data without using selenium, and without clicking on the "Load more" button ?? (if there is, I would be grateful if you share it)
I looked at the json that comes there, but everywhere the value is null
5fe363ddb6d87851632061.png5fe363e4eeab2910614358.png5fe363ea0808d492002723.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill, 2020-12-23
@isaac-21

1. The browser sends a GET request by default, and your button sends a POST
2. You missed the data that the button sends
5fe36adb4d23c746119151.jpeg
Here is the working code:

import requests
data = {
    'params[rows]': 10,
    'params[type]': 0,
    'params[season]': 'all',
    'params[direction]': 'desc',
    'params[order]': 'points_sum',
}
p = requests.post('https://albertparty.ru/api/get_new_rows', data)
print(p.text)

Test)
PS With each click on the button, the value of params[rows] increases by 10. That is, on the second click, you need to pass'params[rows]': 20

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question