unfeightt

Results 5 comments of unfeightt

> 可能是结构发生了变化,我也不行。但是我把cookies.py里面的login_successfully()函数的(By.CLASS_NAME, 'drop-title'),我将之换成(By.CLASS_NAME, 'lite-iconf-profile')成功。即检测那个用户小人头出现,就证明登陆成功。这样我就成功获取到了。 属性多值匹配得用contains()函数了,(By.XPATH, '//div[contains(@class,"lite-iconf-profile")]')

> 改成 url = '[https://www.toutiao.com/api/search/content/?keyword=街拍'+](https://www.toutiao.com/api/search/content/?keyword=%E8%A1%97%E6%8B%8D'+) urlencode(params) > 改成 url = '[https://www.toutiao.com/api/search/content/?keyword=街拍'+](https://www.toutiao.com/api/search/content/?keyword=%E8%A1%97%E6%8B%8D'+) urlencode(params) 中文需要quote一下吧

> ![1562907976(1)](https://user-images.githubusercontent.com/52150648/61103891-8ab2a280-a4a6-11e9-8464-68e6bcba8856.jpg) > > 这两个链接是指向同一个图片的,按照这个正则应该是没有办法爬到大图的 > > [http://p9-tt.byteimg.com/large/dfic-imagehandler/55304da6-077c-4308-9277-68e5db8bd814](url) > 和[http://p3-tt.byteimg.com/large/dfic-imagehandler/55304da6-077c-4308-9277-68e5db8bd814](url) > 指向的又是同一个,所以实际上还是能用 因为large_image_url的写法变了,最早的re表达式匹配不着大图,所以修改了一下

> 小白复制进去,修改了headers,但是出现了'NoneType' object is not iterable这个错误是怎么回事呀?哪位大佬可以解答一下么? 我又跑了一遍,确实有个别item出现这个bug,我觉得是因为个别的item在列表页的image_list是空的或者根本没有这个字段,而把图片都放在详情页了。原作者爬取的只是列表页的所有图片,并不包括详情页,所以你可以自行修改代码去爬取详情页图片,或者直接在1楼代码的基础上加点条件判断,把不符合条件的image_list过滤掉。

> 现在又加了时间戳了吧,请问你时间戳是怎么处理的 时间戳不加也没事啊