Python 漂亮的汤让人失望 从bs4导入美化组 页面=美化组(第2页) self.response.out.write(page.title.string) self.response.out.write(“”) mdays={} mo={} 成本={} ac={} nc={} 月份=(page.findAll('td',style=“边框样式:实心;边框宽度:1px”,align=“RIGHT”)) mo[0]=(月[0]。目录) mdays[0]=月[1]。目录 成本[0]=月[2]。内容 nc[0]=月[4]。目录 ac[0]=月[5]。目录 self.response.out.write(mo[0].string)

Python 漂亮的汤让人失望 从bs4导入美化组 页面=美化组(第2页) self.response.out.write(page.title.string) self.response.out.write(“”) mdays={} mo={} 成本={} ac={} nc={} 月份=(page.findAll('td',style=“边框样式:实心;边框宽度:1px”,align=“RIGHT”)) mo[0]=(月[0]。目录) mdays[0]=月[1]。目录 成本[0]=月[2]。内容 nc[0]=月[4]。目录 ac[0]=月[5]。目录 self.response.out.write(mo[0].string),python,google-app-engine,null,beautifulsoup,Python,Google App Engine,Null,Beautifulsoup,first out.write语句打印标题,其余语句打印Null Beauvuly Soup代码在空闲时正常工作,但在AppEngine上不能正常工作 from bs4 import BeautifulSoup page=BeautifulSoup(page2) self.response.out.write(page.title.string) self.response.out.write("""<br />""") mdays={} mo={} cost={} ac={}

first out.write语句打印标题,其余语句打印Null Beauvuly Soup代码在空闲时正常工作,但在AppEngine上不能正常工作

from bs4 import BeautifulSoup


page=BeautifulSoup(page2)
self.response.out.write(page.title.string)
self.response.out.write("""<br />""")

mdays={}
mo={}
cost={}
ac={}
nc={}
month=(page.findAll('td',style="border-style: solid; border-width: 1px", align="RIGHT"))

mo[0]=(month[0].contents)
mdays[0]=month[1].contents
cost[0]=month[2].contents
nc[0] = month[4].contents
ac[0]=month[5].contents
self.response.out.write(mo[0].string)