Share your "about:you;" submissions here!

← Back to all posts
About Foster_Bryant
Foster_Bryant (94)

It displays information about me and it shows real time data fo the stocks in my personal portfolio. lol I didn't know what to make.

EDIT: I was the first to post on challenge :O

Commentshotnewtop
WilliamB (6)

So simple but so good - I like it a lot

Foster_Bryant (94)

@WilliamB wow thanks. I made this in 5 minutes during the middle of class tho lol

kingretracted (17)

:clap:
When you grab the data from the website, how do you separate the text? If you could can you tell me how to separate with classes?

Foster_Bryant (94)

@kingretracted Yeah gimme a sec im gonna try to explain as best as I can in a few mins lol

Foster_Bryant (94)

@kingretracted to seperate it by class u do for example:
$ python

import requests
from bs4 import BeautifulSoup

soup.find("div", {"class":"usernames"})

The format for it is:

import requests
from bs4 import BeautifulSoup

soup.find("html tag name", {"type of css selector":"name of the css selector"})

and to get the text just do for example:

import requests
from bs4 import BeautifulSoup

print(soup.find("div", {"tbody":"esdhfesj sefjsejses"}).get_text())

Please add me to a repl.it or ask for further help if u need it cus it's kidna hard for me to explain things ;-;

kingretracted (17)

How do I add you? I'll try this out, looks amazing!

@Foster_Bryant

Foster_Bryant (94)

@kingretracted if you go to a repl you can clcik the purple invite button lol its to the left of the run button or atleast near it usually. :P also thx

NarwhalFanatic (0)

Umm it's giving an error when I press enter???

nN34398Ff (77)

atribute error: 'NoneType' object has no attribute find

Foster_Bryant (94)

@nN34398Ff You probably ran the program after 4 PM or before 9:30 AM

JacobMacLeod (11)

Wow, you got Beautiful Soup working? I have been trying for ages! Do you know how to get information inside a table, like Crypto names and prices from Coin Gecko?

Foster_Bryant (94)

@JacobMacLeod When I get out of school maybe I can help you. Also wdym by a table? Do u mean like with pandas? But yeah I can help u with coingecko beautiful soup probably when i get out of school

JacobMacLeod (11)

@Foster_Bryant Ok, here is a screenshot:

As you can see in the middle-right, in the highlighted part, it shows the price of bitcoin ($8647.97) and the name of bitcoin(BTC). My question is, how do I get these values (and store them in a variable)? It looks like they are in an HTML span tag inside a class that is inside a table.

Foster_Bryant (94)

@JacobMacLeod

import requests
from bs4 import BeautifulSoup

bruh = soup.find("span", {"class":"no-wrap"}).get_text()

^ This might work but I haven't tested it since I'm in the middle of class. maybe try printing the code I wrote above and see it's output. Don't forget the header and url that u need for beautiful soup. if you're confused reply to this comment I can help u

Foster_Bryant (94)

@JacobMacLeod nvm I made a program that gets this price. ask questions if u need too https://repl.it/@Foster_Bryant/coingecko

generationXcode (33)

Is this a mutual fund? Because how can you invest in equity before you become an adult?
Thanks!