Giter VIP home page Giter VIP logo

yandex-search's People

Contributors

codinguncut avatar

Stargazers

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

Watchers

 avatar  avatar

yandex-search's Issues

KeyError: 'code' when trying to send a search query

Hello! I'm trying to use this module installed from pip in Gentoo (Gentoo Base System release 2.3) under IPython 5.3.0 with Python 3.5.3 and getting the following error:

`In [10]: yandex.search('"Interactive Saudi"')
...:

KeyError Traceback (most recent call last)
in ()
----> 1 yandex.search('"Interactive Saudi"')

/home/kosc/.local/lib64/python3.5/site-packages/yandex_search/init.py in search(self, query, page, group_by_domain)
166 page=page,
167 group_by_domain=group_by_domain)
--> 168 return self._parse_xml(xml)

/home/kosc/.local/lib64/python3.5/site-packages/yandex_search/init.py in _parse_xml(self, xml)
140 """ parse information from xml into YandexResult object """
141 root = etree.XML(xml)
--> 142 self._raise_on_error(root)
143
144 # request = root.xpath('./request')

/home/kosc/.local/lib64/python3.5/site-packages/yandex_search/init.py in _raise_on_error(self, tree)
102 if errors:
103 error = errors[0]
--> 104 code = int(error.attrib['code'])
105 message = ' '.join(error.xpath('.//text()'))
106

src/lxml/lxml.etree.pyx in lxml.etree._Attrib.getitem (src/lxml/lxml.etree.c:68664)()

KeyError: 'code'
`

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.