tothemoon96 / simple_stock_crawler

1 stars 0 forks source link

修改代码格式 #6

Closed jiminHuang closed 8 years ago

jiminHuang commented 8 years ago
number_of_total_page_ustr_list = \
    response.css('.page_info').xpath('./text()').extract()
    fake_item['stock_market_link'] = '{0}/{1}'.format(
        'http://q.10jqka.com.cn/stock/thshy',
        fake_data['hycode']
    )
jiminHuang commented 8 years ago
return (
    u"<ItemTable(stock_market='{0}',"
    u"stock_market_link='{1}',"
    u"scrape_time=='{2}')>"
).format(
   self.stock_market,
   self.stock_market_link,
   self.scrape_time
)
- 行47-52 既然exception会往上抛 你可以转换一下思路 在insert外用一个方法try住再处理 不是更好么
- 行63-64 没必要弄出一个变量出来