Hi i was scraping yahoo finance and i wanted the print the stock if it is greater than 50 but i did not work anyway here is the code:
import urllib2
from bs4 import BeautifulSoup as bs4
list = ["aapl","goog"]
i = 0
while i < len(list):
url = urllib2.urlopen("http://ift.tt/Jz88mB"+ list[i] +"&q1=1")
soup = bs4(url,"html.parser")
for price in soup.find(attrs={'id':"yfs_l84_" + list[i]}):
print "something"
i += 1
if price > 200:
print price
Aucun commentaire:
Enregistrer un commentaire