urllib is not working
See original GitHub issueTest Code
import urllib.request
response = urllib.request.urlopen('http://python.org/')
Expected and Actual Results
Expected
Ok
Actual
Internal Javascript error: NS_ERROR_FAILURE: <[Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://www.brython.info/src/py_import.js line 140 > eval :: ajax.$dict.send :: line 68" data: no]>
<completed in 548.00 ms>
Test Environment
Brython version: 3.2.2 (on line editor)
Ubuntu Gnome 14.04 - Firefox 40
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Python urllib urlopen not working - Stack Overflow
You tried to use the Python 3 library in Python 2. Use: import urllib2 sock = urllib2.urlopen("http://diveintopython.org/") htmlSource = sock.
Read more >HOWTO Fetch Internet Resources Using The urllib Package ...
urllib.request is a Python module for fetching URLs (Uniform Resource Locators). It offers a very simple interface, in the form of the urlopen...
Read more >What is the urllib module in Python 3? - Educative.io
Urllib is a Python 3 package that allows you to access, and interact with, websites using their URL's (Uniform Resource Locator). It has...
Read more >Fix the module not found import error for urllib2 and urllib3
In today's post we would like to show how to easily fix error messages when importing the urllib2 library. The solution is pretty...
Read more >Python 3 Programming Tutorial - urllib module
The urllib module in Python 3 allows you access websites via your program. This opens up as many doors for your programs as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also when I tried in the console with
req = urllib.request.Request()
I got
AttributeError: 'module' object has no attribute 'Request'
Hi, I also got an error when importing the
urllib.parse
. I tried in the console withimport urllib.parse
but gotImportError: cannot import name 'unicode_iscased'