依照老师思路,自己写出来:https://github.com/jounghu/python-baike-spider
欢迎fork,欢迎star。
欢迎fork,欢迎star。
2017-08-17
File "G:\Myeclipse\imooc_py\test\test_bs4.py", line 2
SyntaxError: Non-ASCII character '\xc4' in file G:\Myeclipse\imooc_py\test\test_bs4.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
那些html/href都有红色波浪线
SyntaxError: Non-ASCII character '\xc4' in file G:\Myeclipse\imooc_py\test\test_bs4.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
那些html/href都有红色波浪线
2017-08-17
https://github.com/oldbig-carry/python_baidu_spider 基于python3 亲测成功 2017/8/13 欢迎fork,star就更好了
可以把table,td改成a,p,输出的html会整齐些
for data in self.datas:
fout.write('<a href="%s">%s</a>' % (data['url'],data['title']))
fout.write('<p>%s</p>' % data['summary'])
for data in self.datas:
fout.write('<a href="%s">%s</a>' % (data['url'],data['title']))
fout.write('<p>%s</p>' % data['summary'])
2017-08-12