krypton-byte / brainly-scraper

brainly apigraphql
https://krypton-byte.github.io/brainly-scraper/
12 stars 6 forks source link

How can I scrape answers #2

Open Tems-py opened 3 years ago

Tems-py commented 3 years ago

Can I scrape answers using this lib?

from brainly_scraper import brainly
print(brainly("""Uporządkuj chronologicznie wydarzenia.
A. utworzenie PZPR
B. referendum ludowe
C. uchwalenie Konstytucji PRL
D. wybory do sejmu ustawodawczego​""", 1))

I have this code and it only gives me:

[<( QUESTION: 1 ANSWER:2 )>]

and I have no idea how to get something more than this

krypton-byte commented 3 years ago
>>> scrap=brainly("""Uporządkuj chronologicznie wydarzenia.
A. utworzenie PZPR
B. referendum ludowe
C. uchwalenie Konstytucji PRL
D. wybory do sejmu ustawodawczego​""", 1)
>>> for i in scrap:
...    print(f"Q: {i.question.content}")
...    for answer in enumerate(i.answers):
...        print(f"A{answer[0]}: {answer[1].content}")

Docs: https://krypton-byte.github.io/brainly-scraper/