Foreword

Finally, I decide to write down my everyday in the blog. Time to time, there is an impuls in my heart to force me to do something. But acedia beat him always. Nevertheless, I still long for success, which in the job, English speaking, and life. I always dream to live freely and leisurely, but for now, I just understand what kind of life it is. The precondition is one must comply with some basic rules, or say custom. You can not live live promiscuously and self-indulgently. Ironically, I did like this exactly past many years. The good thing is, I realize the truth now.

 

As Kaifu Lee said, "The Internet is a tool, not a toy." He is definitely right. However, most people did it in the contrary way, including me. We took much long time on other things, no time left for our study and creating. Time makes change, and change could be progress. Yes, our life needs progress. Run back over the past, the advancement I made is really less than I expected. The time seems run over me. How many changes left for me to win again? I don't know very well. But waht I know is, it is good case at present.

 

Here is a good place I can found so far, where exsits technique and life. Take here as the begining, I will insist to write down my work, my life, my progress in English everyday. I hope I will be conditioned to writting although it is a tool to force me to keep working now.

这段代码只输出最后一个网站的内容是因为在循环中只是将每个play输出了,并没有将其他的信息输出。可以将每个网站的信息放在一个字典中,再将这些字典放在一个列表中,最后输出整个列表即可。修改后的代码如下: ``` detail_selector = parsel.Selector(detail_html) title = detail_selector.css('.b_crumb_cont *:nth-child(3)::text').get() comment = detail_selector.css('.title white::text').get() view_count = detail_selector.css('.view_count::text').get() date = detail_selector.css('#js_mainleft > div.b_foreword > ul > li.f_item.when > p > span.data::text').get() days = detail_selector.css('#js_mainleft > div.b_foreword > ul > li.f_item.howlong > p > span.data::text').get() money = detail_selector.css('#js_mainleft > div.b_foreword > ul > li.f_item.howmuch > p > span.data::text').get() character = detail_selector.css('#js_mainleft > div.b_foreword > ul > li.f_item.who > p > span.data::text').get() play_list = detail_selector.css('#js_mainleft > div.b_foreword > ul > li.f_item.how > p > span.data > span::text').getall() result_list = [] for play in play_list: result_dict = {} result_dict['title'] = title result_dict['comment'] = comment result_dict['view_count'] = view_count result_dict['date'] = date result_dict['days'] = days result_dict['money'] = money result_dict['character'] = character result_dict['play'] = play result_dict['detail_url'] = detail_url result_list.append(result_dict) print(result_dict) time.sleep(random.randint(3,5)) ``` 这样就能够输出每个网站的所有信息了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值