Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > urlopen

Reply
Thread Tools

urlopen

 
 
Dave Dean
Guest
Posts: n/a
 
      04-26-2007
Hi all,
I'm running into some trouble using urllib.urlopen to grab a page from our
corporate intranet. The name of the internal site is simply http://web (no
www or com). I can use urlopen to grab a site like http://www.google.com
just fine. However, when I use urlopen to grab the internal site, I instead
get data from http://www.web.com. This is the url returned by the geturl()
function.
There must be a way to stop Python, or whoever is doing it, from changing
my url. Maybe urllib is not the correct approach. Does anyone know a
solution to this?
Thanks,
Dave


 
Reply With Quote
 
 
 
 
kyosohma@gmail.com
Guest
Posts: n/a
 
      04-26-2007
On Apr 26, 12:39 pm, "Dave Dean" <(E-Mail Removed)> wrote:
> Hi all,
> I'm running into some trouble using urllib.urlopen to grab a page from our
> corporate intranet. The name of the internal site is simplyhttp://web(no
> www or com). I can use urlopen to grab a site likehttp://www.google.com
> just fine. However, when I use urlopen to grab the internal site, I instead
> get data fromhttp://www.web.com. This is the url returned by the geturl()
> function.
> There must be a way to stop Python, or whoever is doing it, from changing
> my url. Maybe urllib is not the correct approach. Does anyone know a
> solution to this?
> Thanks,
> Dave


Dunno for sure, but maybe you should be using urllib2. Good info on
the module can be found here: http://www.voidspace.org.uk/python/a...#fetching-urls

I suppose you could also edit your hosts file too.

Mike

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
urllib2.urlopen hangs, urllib.urlopen works? Chris Python 0 07-10-2005 06:40 PM
Re: urllib.urlopen with threads Chris Withers Python 0 10-09-2003 12:34 PM
urllib.urlopen with threads Chris Withers Python 0 10-09-2003 09:23 AM
How to make URLLIB .urlopen(url1) .urlopen(url2) session related ? Xu, C.S. Python 5 09-17-2003 01:50 PM
Q: urlopen() and "file:///c:/mypage.html" ?? MAK Python 5 08-22-2003 05:47 PM



Advertisments