Hi,
I wonder if someone here could tell me how to put a variable into a URL. My script goes into Yahoo Finance and grabs information about a company (the name and age of the CEO).
import urllib2
f = open('ticker.txt') # ticker.txt is a list of company tickers. The first ticker is Aflac, AFL
line = fileobject.readline() # This reads the first line, AFL.
The problem is line 3. What I get with this is a company with the ticker LINE, not Aflac. How do I put the variable containing AFL into the URL?
I've looked around a bit and can't find an answer. If anyone here knows, I would appreciate hearing from you.
Dan