1
我是否能值us_price
轉換爲整數後,執行以下操作:轉換爲urllib.request裏整數
import urllib.request
page = urllib.request.urlopen ("http://au.finance.yahoo.com/q?s=AUDUSD=X")
text = page.read().decode("utf8")
where1 = text.find('yfs_l10_audusd=x">')
start_of_us_price = where1 + 18
end_of_us_price = start_of_us_price + 6
us_price = text[start_of_us_price:end_of_us_price]
我試圖usp = int(us_price)
無濟於事
'print(type(us_price))`和`print(us_price)`的輸出是什麼? – 2011-01-14 00:09:31