2018-05-17 喜马拉雅页面解析报错
zhongwangninja opened this issue · comments
$ python app.py ximalaya 4286962
Traceback (most recent call last):
File "app.py", line 23, in <module>
main()
File "app.py", line 20, in main
myinstance.album()
File "/Users/vin/project/tools/Quicksilver/spider/ximalaya.py", line 30, in album
zhubo_id = soup.find('div', 'picture').a['href'][7:-1]
AttributeError: 'NoneType' object has no attribute 'a'
python 2.7.11 下执行 喜马拉雅一个专辑的更新时报错,看起来是解析 html 报错了,2018-05-17 突然出现,怀疑可能和喜马拉雅今天页面更新有关系,麻烦大拿帮忙看看
spider/ximalaya.py 是根据 html 解析专辑和播客的信息
确认为喜马拉雅的页面修改导致的解析失败,已解决
怎么解决的,有木有新的代码
zhongwangninja <notifications@github.com> 于 2018年5月18日周五 19:38写道:
… Closed #11 <#11>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Ae5FH43utOfi9pE3-UCN8VrBtdFgjzJQks5tzrLFgaJpZM4UCfY2>
.
可以参考我 fork 的 Quicksilver,基本没有改变作者的思路,对喜马拉雅的新页面做了解析。
不过我的脚本有一些针对自己的需求定制化的东西,没法对作者的代码提交合并了。
另外,这两天使用的过程中发现喜马拉雅的页面 class 会变动,解析页面的这种方式后续估计没法做到很稳定了,得隔一段时间就修改一下代码。
好吧,这意味着这一块要翻车啊
zhongwangninja <notifications@github.com> 于 2018年5月23日周三 16:42写道:
… 可以参考我 fork 的 Quicksilver,基本没有改变作者的思路,对喜马拉雅的新页面做了解析。
不过我的脚本有一些针对自己的需求定制化的东西,没法对作者的代码提交合并了。
另外,这两天使用的过程中发现喜马拉雅的页面 class 会变动,解析页面的这种方式后续估计没法做到很稳定了,得隔一段时间就修改一下代码。
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ae5FH3QLXJH0FE8PHcMc9cK0tpwSPBVDks5t1SEDgaJpZM4UCfY2>
.