Coder Social home page Coder Social logo

pygoogle's People

Watchers

 avatar

pygoogle's Issues

Module usage in Python v3

What steps will reproduce the problem?
1. apply 2to3 to pygoogle.py
2. run script:
from pygoogle import pygoogle
g = pygoogle('quake 3 arena')
g.pages = 5
print(g.get_result_count())
print(g.get_urls()[0])

What is the expected output? What do you see instead?
Expected output: number of search results followed by a first result link
Seen output:

Traceback (most recent call last):
  File "somepath", line 4, in <module>
    print(g.get_result_count())
  File "C:\Python33\lib\site-packages\pygoogle.py", line 189, in get_result_coun
t
    search_results = self.__search__()
  File "C:\Python33\lib\site-packages\pygoogle.py", line 106, in __search__
    data = json.loads(search_results.read())#.decode('utf-8')) #by andervish 05.
05.2014
  File "C:\Python33\lib\json\__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "C:\Python33\lib\json\decoder.py", line 352, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: can't use a string pattern on a bytes-like object

What version of the product are you using? On what operating system?
using r7 revision of pygoogle.py installed with r2 setup.py

Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit 
(AMD64)] on win32

Please provide any additional information below.

Suggested solution: on line 106 of pygoogle.py for Python3 change
            data = json.loads(search_results.read())
to
            data = json.loads(search_results.read().decode('utf-8'))

Original issue reported on code.google.com by [email protected] on 4 May 2014 at 11:41

install error

What steps will reproduce the problem?
1. install

root@pygoogle]# python setup.py install
running install
running build
running build_py
running install_lib
copying build/lib/pygoogle.py -> /usr/lib/python2.4/site-packages
byte-compiling /usr/lib/python2.4/site-packages/pygoogle.py to pygoogle.pyc
  File "/usr/lib/python2.4/site-packages/pygoogle.py", line 146
    finally:
          ^
SyntaxError: invalid syntax


Original issue reported on code.google.com by [email protected] on 22 Jun 2013 at 9:42

Robot problem

The program works fine but after 3-4 times google find that it is a robot,not a 
user agent so it returns error...How can i fix this problem ?

Original issue reported on code.google.com by [email protected] on 8 Feb 2015 at 7:23

50 query limit

What steps will reproduce the problem?
1. Run the following code in the python interpreter:
from pygoogle import pygoogle
a = []
for i in range(100):
    a.append(pygoogle('hello world', pages=0).get_result_count()


What is the expected output? What do you see instead?
Eventually it will start spitting 'NoneType' object is not subscriptable 
instead of continuing to return results.

What version of the product are you using? On what operating system?
Latest version on Ubuntu 11.04

Please provide any additional information below.
I know that this is a limitation of the Google Custom Search API, but I was 
wondering where and how I can modify your module to add in an API key.  

Thanks.



Original issue reported on code.google.com by [email protected] on 5 Aug 2011 at 10:02

get_urls:not returning the url as strings to the console

What steps will reproduce the problem?
1. from pygoogle import pygooogle
2. g=pygoogle('news')
3. g.pages=2
4.g.get_urls

What is the expected output? What do you see instead?

expected:www.news.google.com,(other sources of news),

getting:<bound method pygoogle.get_urls of <pygoogle.pygoogle instance at 
0x1018a5b90>>


What version of the product are you using? On what operating system?
python 2.7.8 system Mac ,OS:10.10 Os Yosemite

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 16 Sep 2014 at 5:55

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.