Shaozhong SHI wrote:
The following is used in a loop to get response code for each url.
print (urllib.request.urlopen(url).getcode())
However, error message says: URLError:
11001 == WSAHOST_NOT_FOUND.
Look in any 'winsock.h' header:
#define WSAHOST_NOT_FOUND (WSABASEERR+1001
On Sun, 13 Feb 2022 at 07:17, Shaozhong SHI wrote:
>
> The following is used in a loop to get response code for each url.
>
> print (urllib.request.urlopen(url).getcode())
>
> However, error message says: URLError: getaddrinfo failed>
>
> Python 3.6.5 is being used to
On 2022-02-12 20:15:43 +, Shaozhong SHI wrote:
> The following is used in a loop to get response code for each url.
>
> print (urllib.request.urlopen(url).getcode())
>
> However, error message says: URLError: getaddrinfo failed>
>
> Python 3.6.5 is being used to tes
The following is used in a loop to get response code for each url.
print (urllib.request.urlopen(url).getcode())
However, error message says: URLError:
Python 3.6.5 is being used to test whether url is live or not.
Can anyone shed light on this?
Regards,
David
--
https://mail.python.org
python 2.5.2
errno, strerror and message do not appear to be set in the following
two cases (at least).
Is this to be expected? (as an aside, arg[0] is set)
# case 1
> print exception, exception.errno, exception.strerror, exception.message == ''
None None True
# case 2
> print exception, exce
On Jun 8, 12:58 pm, Steven D'Aprano wrote:
> On Mon, 08 Jun 2009 12:14:18 +0100, Mark Devine wrote:
> > Hi
> > I wonder if someone could point me in the right direction. I used the
> > following code to access gmail but I got a
> > urllib2.URLError:
On Mon, 08 Jun 2009 12:14:18 +0100, Mark Devine wrote:
> Hi
> I wonder if someone could point me in the right direction. I used the
> following code to access gmail but I got a
> urllib2.URLError:
> error when I ran it. I have included the Traceback
>
> import
Hi
I wonder if someone could point me in the right direction. I used the
following code to access gmail but I got a
urllib2.URLError:
error when I ran it. I have included the Traceback
import twill, string, os
b=twill.commands.get_browser()
b.set_agent_string("Mozilla/5.0 (Windo
i update via http proxy
cmd>set HTTP_PROXY=http://cache.mycompany.com:3128
cmd>python appcfg.py update myapp
URLError:
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\appcfg.py", line 60,
in
run_file(__file__, globals())
File "C:
ile "C:\PROGRA~1\Python26\lib\urllib2.py", line 361, in
> _call_chain
> result = func(*args)
> File "C:\PROGRA~1\Python26\lib\urllib2.py", line 1163, in
> unknown_open
> raise URLError('unknown url type: %s' % type)
> urllib2.URLError:
A
uot;, line 383, in open
response = self._open(req, data)
File "C:\PROGRA~1\Python26\lib\urllib2.py", line 406, in _open
'unknown_open', req)
File "C:\PROGRA~1\Python26\lib\urllib2.py", line 361, in
_call_chain
result = func(*args)
File "C:\PROGR
program runs after I
> > added code based on your example but the program still aborts and none
> > of the code ("Temporary failure, Skip/Halt/try Again?" or "Unknown
> > response, boo hiss to you!") in your example is displayed.
>
> Try replacing the line:
&
code ("Temporary failure, Skip/Halt/try Again?" or "Unknown
> response, boo hiss to you!") in your example is displayed.
Try replacing the line:
except URLError, e:
with:
except urllib2.URLError, e:
and see if that helps.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
offending code with a try...except loop, something similar
> to this.
>
> try:
> contents = urllib2.urlopen(url).read()
> except URLError, e:
> if e.errno == 10053:
> # "Software caused connection abort"
> response = raw_input(
>
y abort details. Can anyone
> help with catching the
> abort before program aborts or provide code to automatically start
> program?
Yes. Wrap the offending code with a try...except loop, something similar
to this.
try:
contents = urllib2.urlopen(url).read()
except URLError, e:
, line 353, in _call_chain
result = func(*args)
File "C:\Python25\lib\urllib2.py", line 1100, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python25\lib\urllib2.py", line 1075, in do_open
raise URLError(err)
URLError:
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]:
>Help please with a URLError.
Post your code (a small self-contained example, preferrably) and the URL.
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Help please with a URLError. Invoking a url that works in Firefox and
IE results in a "urlerror 7, no address ..." in python. I need to debug
why.
Traceback is below. There's a redirect when the url is invoked (it's
part of a chain) - you can see it using liveheaders in firef
Urlopen error - (7, 'getaddrinfo failed')
It means their tracker is overworked. Nothin you can do
about it.. let it run.. it should start workin sooner or
later.
--
http://mail.python.org/mailman/listinfo/python-list
urllib2.py", line 129, in urlopen
return _opener.open(url, data)
File "C:\Python23\lib\urllib2.py", line 326, in open
'_open', req)
File "C:\Python23\lib\urllib2.py", line 306, in _call_chain
result = func(*args)
File "C:\Python23\lib\urllib2.py&q
20 matches
Mail list logo