运行后报错,是不是解析问题.
Traceback (most recent call last):
File "D:/pycharm项目/spider_novel.py", line 124, in <module>
main()
File "D:/pycharm项目/spider_novel.py", line 84, in main
h1_soup = BeautifulSoup(html1,'html.parser')# 主页
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\bs4\__init__.py", line 245, in __init__
elif len(markup) <= 256 and (
TypeError: object of type 'NoneType' has no len()
?
厉害了
不明觉厉
谢谢LZ无私奉献
!!!
先看为敬
借鉴学习理解{:10_256:}
上车了,滴滴滴
真厉害,学的好快啊
学习一下
谢谢分享
感谢分享
66666666666666
{:9_218:}
看看楼主的成果
在pycharm运行报错 :
UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 84 of the file D:/pycharm项目/fengzhuang.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.
h1_soup = BeautifulSoup(html1)# 主页
Traceback (most recent call last):
File "D:/pycharm项目/fengzhuang.py", line 124, in <module>
main()
File "D:/pycharm项目/fengzhuang.py", line 84, in main
h1_soup = BeautifulSoup(html1)# 主页
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\bs4\__init__.py", line 245, in __init__
elif len(markup) <= 256 and (
TypeError: object of type 'NoneType' has no len()
太强了,希望能直接用
从入门到高手,谢谢分享,也让小白学习一下。
牛牛牛
6