"HTTP404NotFound" problem

23 views
Skip to first unread message

Martin Yu

unread,
Apr 24, 2013, 6:34:27 AM4/24/13
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?





Reply all
Reply to author
Forward
0 new messages