Giter Site home page Giter Site logo

samzhangjy / baiduspider Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 13.0 44.72 MB

项目已经移动至:https://github.com/BaiduSpider/BaiduSpider !! 一个爬取百度搜索结果的爬虫,目前支持百度网页搜索,百度图片搜索,百度知道搜索,百度视频搜索,百度资讯搜索,百度文库搜索,百度经验搜索和百度百科搜索。

Home Page: https://samzhangjy.github.io/BaiduSpider

License: MIT License

Python 76.31% JavaScript 2.84% Vue 19.52% Dockerfile 0.25% HTML 1.08%
python3 spider crawling crawling-python python baidu api spiders baiduspider

baiduspider's Introduction

Hi there 👋, I'm Sam Zhang

Feel free to send me Emails!

I'm still a student, though... I might not be avilable on work days.

samzhangjy's github stats

baiduspider's People

Contributors

dependabot[bot] avatar samzhangjy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

baiduspider's Issues

百度新闻功能报错[BUG]

运行代码
pprint(BaiduSpider().search_news('爬虫'))

报错为
AttributeError: 'NoneType' object has no attribute 'findAll'

尝试更换不同关键词,报错均相同,猜测返回值为空。本机上运行网页搜索时(函数为BaiduSpider().search_web),可正常返回。

  • 操作系统: win10
  • Python版本: 3.6

搜索语句错误,或者是我不会使用

命令调用:pprint(spider.search_web(word=input('要搜索的关键词:')))

Traceback (most recent call last):
File "", line 1, in
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/line/PycharmProjects/untitled/BaiduSpider-master/sousuo.py", line 8, in
pprint(spider.search_web(word=input('要搜索的关键词:')))

TypeError: search_web() got an unexpected keyword argument 'word'

正常调用
pprint(spider.search_web('问题'))
pprint(spider.search_pic('问题'))
pprint(spider.search_web(input('请输入问题')))
pprint(spider.search_pic(input('请输入问题')))

I won't use it

Sorry

Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/docrunner.py", line 309, in
tests = finder.find(module, module.name)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 932, in find
self._find(tests, obj, name, module, source_lines, globs, {})
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 995, in _find
globs, seen)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 1029, in _find
globs, seen)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 982, in _find
test = self._get_test(obj, name, module, globs, source_lines)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 1066, in _get_test
filename, lineno)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 668, in get_doctest
return DocTest(self.get_examples(string, name), globs,
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 682, in get_examples
return [x for x in self.parse(string, name)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 644, in parse
self._parse_example(m, name, lineno)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 714, in _parse_example
lineno + len(source_lines))
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/doctest.py", line 800, in _check_prefix
(lineno+i+1, name, line))
ValueError: line 72 of the docstring for 2.BaiduSpider.search_web has inconsistent leading whitespace: ' - 带页码:'

Process finished with exit code 1

提问

pprint(spider.search_video(input('')))

输入内容带有loli,就会崩溃
loli
lolita
萝莉
咯哩
洛丽塔
等等

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.