Home python Can't go to Cabinet.ruOBR.ru via Requests

Can’t go to Cabinet.ruOBR.ru via Requests

Author

Date

Category

I want to parse from the site, but the site does not allow me.

import requests
Url = 'https://cabinet.ruobru.ru/login/'
Url2 = 'https://cabinet.ruobr.ru/child/studies/journal/'
PAYLOAD = {
  'username': 'log',
  'Password': 'pass'
}
Headers = {
  'User-Agent': 'Mozilla / 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit / 537.36 (KHTML, LIKE GECKO) Chrome / 60.0.3112.113 Safari / 537.36'}
With Requests.session () AS C:
  C.Post (URL, Headers = Headers, Data = PAYLOAD)
  R = C.GET (URL2, Headers = Headers)
  Print (R.Text) displays the authorization page

What should I do, what would the site missed me? In no way, the TC does not remember them. Through the selenium everything works fine.


Answer 1, Authority 100%

Home tasks can be sprawling using the API of their mobile application, use the RUOBR_API module.

pip install ruobr_api
from rubr_api import rubr_api import
R = RUOBR ('UserName', 'Password')
Print (R.Gethomework ("2020-12-18", "2020-12-31")) # The first date is today, the second - usually plus two weeks
# [Lesson (id = 190272322, Topic = 'Lesson Topic', Task = Task (id = 24898438, title = 'Task Title', Doc = False, Requires_Solutions = False, DeadLine = DateTime.date (2020, 12, 18) , test_id = none, type = 'group'), time_start = datetime.time (9, 45), date = datetime.date (2020, 12, 18), subject = 'item', time_end = datetime.time (10, 25), Staff = 'Surname name Patronymic teacher'), ...]

Reference to the source repository: https://github.com/raitonoberu/ruoobr_api

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions