by
285 9
0
4
3,436
0
Top 1% !
Famous
Specified
OpenSource
Popularity: 2912nd place
Created
Modified Sep 29, 2016
No tags for this snippet yet.
Languagepython
LicenseMIT_X11

Consultando valor da ação no yahoo

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1461634/Consultando-valor-da-a--o-no-yahoo?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
from BeautifulSoup import BeautifulSoup ##from bs4 import BeautifulSoup import urllib2 lista_empresas = ['KLBN4','ETER3','BBDC4','GGBR3','USIM5','BBAS3','GOLL4','CIEL3','OIBR3','BRAP3','OGXP3','RUMO3','BRKM5'] for empresa in lista_empresas: pagina = urllib2.urlopen("https://br.financas.yahoo.com/q?s=" + empresa + ".SA").read() soup = BeautifulSoup(pagina) links = soup.findAll('span') print empresa + ' - ' + str(links[23].findAll(text=True)[0])
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus