Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1011817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:51:03+00:00 2026-05-16T09:51:03+00:00

I trying to get yahoo prices into sqlite… I have the code below, but

  • 0

I trying to get yahoo prices into sqlite…
I have the code below, but cant get the data into ipull []
then into sqlite…

from urllib import urlopen  
import win32com.client as win32  
import sqlite3

RANGE = range(3, 8)  
COLS = ('TICKER', 'PRICE', 'Vol')  
URL = 'http://quote.yahoo.com/d/quotes.csv?s=%s&f=sl1v' 
TICKS = ('GGP', 'JPM', 'AIG', 'AMZN')  
ipull =[]

def excel():
    app = 'Excel'
    xl = win32.gencache.EnsureDispatch('%s.Application' % app)
    ss = xl.Workbooks.Add()
    sh = ss.ActiveSheet
    xl.Visible = True

    for x in range(3):
        sh.Cells(5, x+1).Value = COLS[x]
    row = 6

    u = urlopen(URL % ','.join(TICKS))

    for data in u:
        tick, price, per  = data.split(',')
        sh.Cells(row, 1).Value = eval(tick)
        sh.Cells(row, 2).Value = ('%.2f' % float(price))
        sh.Cells(row, 3).Value = eval(per.rstrip())
        row += 1
    u.close()

con = sqlite3.connect('/py/data/db2') 
c = con.cursor()

c.execute('INSERT INTO prices VALUES (?,?,?)', ipull)

con.commit()  
c.close()

if __name__=='__main__':
    excel()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T09:51:04+00:00Added an answer on May 16, 2026 at 9:51 am

    You declare ipull[], but never assign it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get Yahoo stock quote in the following way. but it
I'm trying to get the Yahoo! BOSS package working, but when I try to
Using quantmod and collecting data from Yahoo. I am trying to get the dates
I'm trying to get a csv file from http://download.finance.yahoo.com/d/quotes.csv?s=msft&f=sl1p2 then parse it so that
I'm trying to get the Yahoo Weather with JavaScript. I originally made a proxy,
I'm trying to get the not confirmed warning to go away when using Yahoo!
I am trying to get the data of id yfs_a00_xauusd=x from span from the
i am trying to get the info from yahoo weather in different languages http://developer.yahoo.com/weather/
i'm trying to get coordinates from geolocation for use in my yahoo map.i had
I am trying to get my results to display inside of the loop but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.