0

I am having url open problem with python urllib2

f = urllib2.urlopen(url)

url = http://merchantcircle.com/business/Buffas.Restaurant.and.Lounge.504-949-0038

and getting this url error - dashes after . dots becoming problem i suppose

Unexpected error: class 'urllib2.URLError'

how can i fix this url in order it to be opened with urlopen

Thanks

soField
  • 2,536
  • 9
  • 36
  • 44
  • Have you "percent encoded" the URL? ( see http://stackoverflow.com/questions/1695183/how-to-percent-encode-url-parameters-in-python ) – Ngure Nyaga Oct 28 '12 at 07:34
  • Works for me too, after putting some quotes around the url. – het.oosten Oct 28 '12 at 07:34
  • Post the **full** traceback! The name of the error is just a small piece of information, we need all the information you can provide to correctly answer a question. Also showing a minimal **working** example is useful(=*the smallest* piece of code that has that behaviour) – Bakuriu Oct 28 '12 at 09:34

1 Answers1

0

There's no actual error with that URL.

In [1]: import urllib2
In [2]: url = 'http://merchantcircle.com/business/Buffas.Restaurant.and.Lounge.504-949-0038'
In [3]: urllib2.urlopen(url)
Out[3]: <addinfourl at 46996224 whose fp = <socket._fileobject object at 0x2cb6ad0>>

If you post some real code you may get better help.

KayEss
  • 2,290
  • 15
  • 31