Martin Yu
unread,Apr 24, 2013, 6:34:27 AM4/24/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Pattern
Hi:
I wrote code like this:
================================================
from pattern.web import *
engine = Google(license='MY_API_KEY')
for result in engine.search('something', cached=False, count=30):
print result.url
================================================
but when I run this simple script in Terminal it keeps showing
following:
================================================
Traceback (most recent call last):
File "url.py", line 5, in <module>
for result in engine.search('something', cached=False, count=30):
File "/Library/Python/2.7/site-packages/pattern/web/__init__.py",
line 1023, in search
data = url.download(cached=cached, **kwargs)
File "/Library/Python/2.7/site-packages/pattern/web/__init__.py",
line 398, in download
data = self.open(timeout, proxy, user_agent, referrer,
authentication).read()
File "/Library/Python/2.7/site-packages/pattern/web/__init__.py",
line 362, in open
if e.code == 404: raise HTTP404NotFound
pattern.web.HTTP404NotFound
================================================
I can't figure out where I made certain mistakes. Does anyone can
help?