M
M
MIKHAN_GO2021-03-31 19:19:35
Python
MIKHAN_GO, 2021-03-31 19:19:35

How to parse data from a site with registration through bs4?

I can not parse data from a site with registration (with an entrance). There is a login, password, but the data is not parsed. I'll attach the code, but nothing is displayed, only an empty array

import requests
from bs4 import BeautifulSoup


url = 'https://www.agrokeep.com/#/station/data'

s = requests.Session()

r = s.get(url)

data = {
    'login':        'тут был логин, но я его убрал',
    'password':         'тут был пароль, но я его убрал',
}

d = s.post(url, data=data, headers=dict(Referer=url))

soup = BeautifulSoup(d.text, 'lxml')
quotes = soup.find_all('button', class_='btn btn-default ng-binding dropdown-toggle')
print(quotes)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-03-31
@SoreMix

Because they are not logged in.
Authorization endpoint different
Data format different
Parameter names different
+ authorization request will not return data from another page

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question