Skip to content
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

403thi/brainlypy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brainlypy

Library to scrape brainly.com graphql API. PyPi page

Requirements

  • Python >= 3.6

Install

Install via pip on terminal

pip install brainlypy

Simple use [EN]

import brainlypy
brainlypy.set_lang('us')
# "pt" to portuguese, "us" to english, "es" to spanish, "id" to indonesian.
# default is 'us'
results = brainlypy.search('value of x')
question = results.questions[0]
print('URL: '+'https://brainly.com/task/'+str(question.databaseid))
print('QUESTION:',question)
print('ANSWER 1:', question.answers[0])
if question.answers_count == 2:
    print('ANSWER 2:', question.answers[1])
# output is:
'''
URL: https://brainly.com/question/24550771
QUESTION: Plz help will Mark brainlest!!

A. As x decreases in value, f(x) increases in value. As x increases in value, f(x) decreases in value.
[ reduced to not take up too much space ]
D. As x decreases in value, f(x) decreases in value. As x increases in value, f(x) increases in value.

ANSWER 1: Answer:
A
Step-by-step explanation:
Well considering how the graph looks, from the x-axis(0,0), the line(x) moves upwards on the left before itf(x) moves downwards on the right
'''

Uso simples [PT]

import brainlypy
brainlypy.set_lang('pt')
# "pt" para português, "us" para inglês, "es" para espanhol, "id" para indonésio.
# o padrão é 'us' (inglês)
results = brainlypy.search('valor de x')
question = results.questions[0]
print('URL: '+'https://brainly.com.br/tarefa/'+str(question.databaseid))
print('QUESTÃO:',question)
print('RESPOSTA 1:', question.answers[0])
if question.answers_count == 2:
    print('RESPOSTA 2:', question.answers[1])
# SAÍDA:
'''
URL: https://brainly.com.br/tarefa/5430425
QUESTÃO: Número primo x número primo = 21
Número primo x número primo = 34
Descubra A e B.

RESPOSTA 1: resposta
a)3×7=21
b)2×17=34


RESPOSTA 2: Resposta:
a- 3×7=21
b-2×17=34
'''

About

Library to scrape brainly.com graphql API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages