2012-01-21 5 views
0

でlxml.html.parseは私のapp.yamlである:ここでは何が問題になっています。ここでは、Googleのアプリ

application: helloworld 
version: 1 
runtime: python27 
api_version: 1 
threadsafe: true 

handlers: 
- url: /.* 
    script: helloworld.app 

libraries: 
- name: lxml 
    version: latest 

はhelloworld.pyです:

from google.appengine.api import urlfetch 
import lxml.html 

down = "http://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htm" 
file = urlfetch.fetch(down) 
print file.content 

root = lxml.html.parse(file.content) 
data = root.xpath('//tr[@class="tr_normal"]/td[position()=1]') 
name = [row.text_content() for row in data] 

for code in name: 
    print code 

私が実行します。

google_appengine/dev_appserver.py helloworld/ 

私は127.0.0.1:8080を開いて、ウェブサイトhttp://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htmを見ることができますが、print file.contentという行から間違った出力があります。

この問題を解決する方法を教えてください。

+1

GAEでもlxmlは存在しません。 – newtover

答えて

1

lxmlはCモジュールで、GAEは純粋なPythonモジュールしかサポートしていないため、サポートされていません。

関連する問題