请问为什么在浏览器访问成功,但是老师的爬虫却显示403错误
来源:17-8 重构与运行

慕粉1069193
2019-05-18
请问我再运行爬虫的时候,自己能在浏览器访问页面,但是运行老师的爬虫的时候确实显示403报错
2019/05/18 13:37:56 Fetcher: error fetching url http://album.zhenai.com/u/1494170114: wrong status code: 403
2019/05/18 13:37:57 Fetching url http://album.zhenai.com/u/1350616214
2019/05/18 13:37:57 Fetcher: error fetching url http://album.zhenai.com/u/1350616214: wrong status code: 403
2019/05/18 13:37:58 Fetching url http://album.zhenai.com/u/1773637113
2019/05/18 13:37:58 Fetcher: error fetching url http://album.zhenai.com/u/1773637113: wrong status code: 403
2019/05/18 13:37:59 Fetching url http://album.zhenai.com/u/1935129652
2019/05/18 13:37:59 Fetcher: error fetching url http://album.zhenai.com/u/1935129652: wrong status code: 403
2019/05/18 13:38:00 Fetching url http://album.zhenai.com/u/1868722712
2019/05/18 13:38:00 Fetcher: error fetching url http://album.zhenai.com/u/1868722712: wrong status code: 403
2019/05/18 13:38:01 Fetching url http://album.zhenai.com/u/1604032751
2019/05/18 13:38:01 Fetcher: error fetching url http://album.zhenai.com/u/1604032751: wrong status code: 403
2019/05/18 13:38:02 Fetching url http://album.zhenai.com/u/104953886
2019/05/18 13:38:02 Fetcher: error fetching url http://album.zhenai.com/u/104953886: wrong status code: 403
2019/05/18 13:38:03 Fetching url http://album.zhenai.com/u/1146711150
2019/05/18 13:38:03 Fetcher: error fetching url http://album.zhenai.com/u/1146711150: wrong status code: 403
2019/05/18 13:38:04 Fetching url http://album.zhenai.com/u/1975813349
2019/05/18 13:38:04 Fetcher: error fetching url http://album.zhenai.com/u/1975813349: wrong status code: 403
2019/05/18 13:38:05 Fetching url http://album.zhenai.com/u/1363528811
2019/05/18 13:38:05 Fetcher: error fetching url http://album.zhenai.com/u/1363528811: wrong status code: 403
2019/05/18 13:38:06 Fetching url http://album.zhenai.com/u/1294095211
2019/05/18 13:38:06 Fetcher: error fetching url http://album.zhenai.com/u/1294095211: wrong status code: 403
2019/05/18 13:38:07 Fetching url http://album.zhenai.com/u/1212288936
2019/05/18 13:38:07 Fetcher: error fetching url http://album.zhenai.com/u/1212288936: wrong status code: 403
2019/05/18 13:38:08 Fetching url http://album.zhenai.com/u/1987256910
2019/05/18 13:38:08 Fetcher: error fetching url http://album.zhenai.com/u/1987256910: wrong status code: 403
2019/05/18 13:38:09 Fetching url http://album.zhenai.com/u/1472255403
2019/05/18 13:38:10 Fetching url http://album.zhenai.com/u/1522713309
2019/05/18 13:38:10 Fetcher: error fetching url http://album.zhenai.com/u/1522713309: wrong status code: 403
2019/05/18 13:38:11 Fetching url http://album.zhenai.com/u/1501598923
2019/05/18 13:38:11 Fetcher: error fetching url http://album.zhenai.com/u/1501598923: wrong status code: 403
2019/05/18 13:38:12 Fetching url http://album.zhenai.com/u/1806147938
2019/05/18 13:38:12 Fetcher: error fetching url http://album.zhenai.com/u/1806147938: wrong status code: 403
2019/05/18 13:38:13 Fetching url http://album.zhenai.com/u/1974405708
2019/05/18 13:38:13 Fetcher: error fetching url http://album.zhenai.com/u/1974405708: wrong status code: 403
2019/05/18 13:38:14 Fetching url http://album.zhenai.com/u/1654436830
2019/05/18 13:38:14 Fetcher: error fetching url http://album.zhenai.com/u/1654436830: wrong status code: 403
2019/05/18 13:38:15 Fetching url http://album.zhenai.com/u/1850672329
2019/05/18 13:38:15 Fetcher: error fetching url http://album.zhenai.com/u/1850672329: wrong status code: 403
1回答
-
ccmouse
2019-05-19
对方网站在我课程推出后不久做了对爬虫的防护。也有同学通过换useragent的方式来获取一小部分数据。同学可以挑选一些其他也同样不用登录就能看数据的网站,比如体育类股票类试试。
00
相似问题