473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Fwd: Hello

Hello ,

Traceback (most recent call last):
File "C:\Python25\hadi_yahoo.py", line 12, in <module>
file_source.write(urllib2.urlopen(req).read())
File "C:\Python25\lib\urllib2.py", line 124, in urlopen
return _opener.open(url, data)
File "C:\Python25\lib\urllib2.py", line 387, in open
response = meth(req, response)
File "C:\Python25\lib\urllib2.py", line 498, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python25\lib\urllib2.py", line 425, in error
return self._call_chain(*args)
File "C:\Python25\lib\urllib2.py", line 360, in _call_chain
result = func(*args)
File "C:\Python25\lib\urllib2.py", line 506, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 999: Unable to process request at this time -- error
999

Previously i got the error which I have attached below when I use just
urlopen . But now when I use this http request
user_agent='Mozilla/3.0(compatible;MISE 5.5;Windows NT)'
headers={'User-Agent':user_agent}
req=urllib2.Request(url,None,headers)
file_source.write(urllib2.urlopen(req).read()

its still giving the error mentioned above .. Iam accessing the yahoo search
engine .. link is "http://search.yahoo.com/search?n=20&p=ipod"

I'm attaching the python file i have written just have a look and suggest me
something that works for this query

Thank You,
Spandana.


---------- Forwarded message ----------
From: spandana g <sp***********@gmail.com>
Date: Thu, Jul 3, 2008 at 2:52 PM
Subject: HTTP request error with urlopen
To: py*********@python.org
Hello ,

I have written a code to get the page source of the google search
page .. this is working for other urls. I have this problem with

import re
from urllib2 import urlopen
string='http://www.google.com/search?num=20&hl=en&q=ipod&btnG=Search'
file_source=file("google_source.txt",'w')
file_source.write(urlopen(string).read())
page_content=file_source.readlines()

Traceback (most recent call last) :
File "C:/Python25/google.py", line 5,in <module>
file_source.write(urlopen(string).read())
File "C:\Python25\lib\urllib2.py", line 124 , in urlopen
return__opener.open(url, data)
File "C:\Python25\lib\urllib2.py", line 387 , in open
response =meth(req, response)
File "C:\Python25\lib\urllib2.py", line 498 , in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python25\lib\urllib2.py", line 425, in error
return self._call_chain(*args)
File "C:\Python25\lib\urllib2.py", line 360, in __call_chain
result = func(*args)
File "C:\Python25\lib\urllib2.py", line 506, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden

Actually urlopen is working for google labs sets page but not for the
google.com and even I have same problem with wikipedia . Please let me know
... If any one of have any idea about this .

Thank You,
Spandana.

Jul 17 '08 #1
0 870

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ralph Freshour | last post by:
Is it possible to inhibit the browser Back/Fwd buttons via PHP? Thanks...
2
by: Vladimir | last post by:
Hello, All! Is there any analogous class/function to sscanf() & fscanf() in C#? In another words, I need to convert string into the set of given variables of different types. Regards,...
12
by: zuhans | last post by:
-------- Original-Nachricht -------- Betreff: backup and restore just with use of jdbc? Datum: Sun, 13 Jun 2004 10:23:53 +0200 Von: zuhans@iname.com <zuhans@iname.com> An:...
1
by: Mario Lacunza | last post by:
--------- Mensaje reenviado -------- De: Mario Lacunza <mario.lacunza@gmail.com> Para: Lista Python Ing <python-list@python.org> Asunto: Problems with PyGridTableBase Fecha: Sat, 09 Sep 2006...
0
by: rrp83 | last post by:
Hi All Can anyone fwd me the code for converting a string to bytes similar to the GetBytes function in C# and viceversa?? Regards, RRP83
0
by: 2Barter.net | last post by:
Fwd: A Blessing found for Daytona Beach Florida Hello This is Craig Oral Somerford and I've been using Gmail and thought you might like to try it out. Here's an invitation to create an...
1
by: James T. Dennis | last post by:
You'd think that using things like gettext would be easy. Superficially it seems well documented in the Library Reference(*). However, it can be surprisingly difficult to get the external details...
1
by: jake77.lucas | last post by:
I'm using 2005.Net C++ compiler. I have a base class in namespace A (call it Class1). I derive another class from it, (call it Class2) defined in namespace B. This derived class contains as a...
0
by: Andrii V. Mishkovskyi | last post by:
2007/10/31, Frank Aune <Frank.Aune@broadpark.no>: You mean something like this: .... print '42' 42 am I right? -- Wbr, Andrii Mishkovskyi.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.