Questions tagged [urlopen]

The urlopen is a method of the urllib library in Python, used to open a particular URL.

The urlopen is a method of the urllib library in Python, used to open a particular URL. As a result, a file-like object is returned that contains information about the URL - headers, response data and other details about the requested URL resource.

369 questions
1
vote
1 answer

"Urlopen error unknown url type" when running Python script from CMD

My goal is to launch my script from windows task scheduler. However, I think the scheduler uses CMD to launch the code - and the CMD does not want to run my script! When I run the script from either Anaconda prompt or Spyder, the script launches…
Ola
  • 81
  • 1
  • 8
1
vote
1 answer

How to reliably process web-data in Python

I'm using the following code to get data from a website: time_out = 4 def tryconnect(turl, timer=time_out, retries=10): urlopener = None sitefound = 1 tried = 0 while (sitefound != 0) and tried < retries: try: …
Kami
  • 241
  • 4
  • 12
1
vote
0 answers

urllib.error.URLError:

I tried retrieving the data from a web page using the Urllib and i keep getting either [WinError 10061] or [WinError 10060] i was told by someone(we're both beginners) that the error maybe from my proxy settings but we both don't know exactly how to…
Duke Sanmi
  • 67
  • 1
  • 6
1
vote
2 answers

urllib.request.urlopen timeout without internet

urllib.request.urlopen has a timeout option. However, when my internet is down that option does not seem to work. import urllib urllib.request.urlopen(url, timeout=1) Hangs and eventually gives URLError:
Mauricio
  • 414
  • 2
  • 11
1
vote
1 answer

How to use urlopen of urllib to save files when login is required?

I used the following Python codes to download files. The codes work when no login and password are required. The target file will be saved in the name of theFile. from urllib.request import urlopen pageUrl =…
H42
  • 725
  • 2
  • 9
  • 28
1
vote
2 answers

python3.6.5 urllib.error.URLError:

I installed python3.6.5 @ centOS 7 and make without error. but when i test for urlopen it raise error below: e*urllib.error.URLError: * I suspect it may related https and i double confirmed i have installed…
Baodi Di
  • 540
  • 2
  • 6
  • 16
1
vote
1 answer

How get the parameters from the url path?

Introductory tags: python | python-3.x | url | parameters | urlopen Used language: Python 3.x Used modules: urlopen | urllib.request Status: Not yet resolved Description of the problem: I have url: …
Stilgar Dragonclaw
  • 127
  • 1
  • 1
  • 11
1
vote
1 answer

Crawler in Python, urlopen not working

I am playing around trying to extract some info from a webpage and I have the following code: import re from math import ceil from urllib.request import urlopen as uReq, Request from bs4 import BeautifulSoup as…
Petris
  • 135
  • 2
  • 10
1
vote
0 answers

Python 3.6.5 - issues using urlopen and downloading contents

I'm relatively new to python and have just started using some of the web functions. But it seems regardless of what I do I can't get a web page to open (url open), and copy the contents to a text file. from urllib.request import urlopen url =…
SkinnyBetas
  • 461
  • 1
  • 5
  • 27
1
vote
1 answer

IBM DataPower - How to handle HTML Response from openurl?

I tried looking for the solution in the forum but I was unable to find something similar to what I'm trying to achieve. I have a gateway script in an MPG which kinda looks like this: session.INPUT.readAsJSON(function (error, json) { if (error){ …
Ray Zabala
  • 11
  • 3
1
vote
1 answer

urllib.request.urlopen of json data returning content-length zero

i have set up a RESTful api on a raspberry pi which connects to my stereo to adjust the volume. it works if i test from YARC (a REST client test extension for Chrome): http://1.2.3.4/yamaha/volume/relative/up/1/ returns this { "status": "OK", …
Eric D'Souza
  • 680
  • 5
  • 21
1
vote
0 answers

urllib2.urlopen I only get part of the web page

Because raptr is closing sooner or later I want to save all my play data. I can access first tab but that's it. How can I get data from 2nd, 3rd etc (It's at the bottom of the screen)? My code: import urllib2 page =…
Hsin
  • 307
  • 5
  • 15
1
vote
0 answers

Is there a smoother way in adding text file to be appended into the URL address bar?

Using Python 3.6.4 on MacBook Pro. Is there a smoother way in adding text file to be appended into the URL address bar? Excuse my ignorance, I'm a novice to Python. And this was my best shot... import urllib import urllib.request import…
1
vote
1 answer

Python 3.6 openurl behaviour is different in windows OS

I'm a beginner in python language i'm trying to use urlopen by with statement to get file content and print all the words of this file. this is the example which i follow: from urllib.request import urlopen with…
1
vote
2 answers

Python 3 : HTTP Error 405: Method Not Allowed

I'm getting 'HTTP Error 405: Method Not Allowed' error. My code is import urllib.request import urllib.parse try: url = 'https://www.google.com/search' values = {'q': 'python programming tutorials'} data =…