question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

urllib is not working

See original GitHub issue

Test 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:closed
  • Created 8 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
jiangllancommented, Oct 19, 2018

Also when I tried in the console with

req = urllib.request.Request()

I got

AttributeError: 'module' object has no attribute 'Request'

0reactions
jiangllancommented, Oct 19, 2018

Hi, I also got an error when importing the urllib.parse. I tried in the console with import urllib.parse but got ImportError: cannot import name 'unicode_iscased'

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found