1
I’m trying to run this code:
import time
import urllib.request
from urllib.request import urlopen
ibov = ['BBAS3.SA', 'PETR4.SA']
def yahooKeyStats(stock):
try:
sourceCode = urllib.request.urlopen ('https://finance.yahoo.com/quote/.../key-statistics?p=' +stock).read()
pl = sourceCode.split('Preço/Livro </td><td class="Fz(s) Fw(500) Ta(end)">')[1].split('</td>')[0]
print ("preço livro:", pl)
except Exception as e:
print (e)
I have already checked all the possibilities and I can not correct. Excuse me the question, that may be silly, but I am starting and I have doubts.
thanks. apologies for not responding before.
– Baco23
@Baco23 if the problem has been solved, do not forget to accept the answer to mark it as solved.
– Pedro von Hertwig Batista