Questions tagged [fancyurlopener]
9 questions
4
votes
0 answers
urllib.request.FancyURLOpener is deprecated, what is better method?
I have been using urllib.request.FancyURLOpener() to retrieve images from URLs. My code is something like this:
class MyOpener(FancyURLopener):
version = "Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127…

CopyOfA
- 767
- 5
- 19
3
votes
2 answers
Trying to use fancyURLopener in Python3 for a PDF, but it gives me a DeprecationWarning error
I am trying to access a PDF file from a bank's website for PDF mining, but it keeps returning HTTP 403 error. So as a workaround, I am trying to change my User-Agent to a browser for accessing the file (and downloading it).
The code below is part of…

bullfighter
- 397
- 1
- 4
- 21
1
vote
0 answers
Alternative for depreciated AppUrlOpener and FancyURLopener
I am a total Python novice and am trying to convert someone elses code from PY2 to PY3 that downloads some xml code and converts it, I am stuck on how to replace the AppUrlOpener
Towards the start there is
class…

Ian Waller
- 11
- 1
1
vote
1 answer
DeprecationWarning: AppURLopener style of invoking requests is deprecated
I wrote a program a while ago and it always was fine until I replaced my hard drive and had to reinstall everything.
This is the code segment I guess that can't work anymore due to depreciation
class AppURLopener(urllib.request.FancyURLopener):
…

qwetjipgjiW3
- 21
- 3
1
vote
1 answer
Python: FancyURLopener fails on second loop, ValueError: read of closed file
\Anaconda3\lib\tempfile.py", line 483, in func_wrapper
return func(*args, **kwargs)
ValueError: read of closed file
I don't know if this is the issue even I can't figure this out. This is being called in a loop and the first loops works fine but…

cakeeater9001
- 11
- 1
0
votes
1 answer
can't send user and password to FancyURLopener getting missing 2 required positional arguments: 'user' and 'passwd'
I thought I was calling this correctly but obviously not. Can someone tell me what I am doing wrong?
import urllib.request
class testURLopener(urllib.request.FancyURLopener):
def __init__(self, user, passwd):
self.__user =…

theakson
- 502
- 7
- 23
0
votes
1 answer
urlopen error [Errno 11001] getaddrinfo failed for a local drive
I am trying to run a code in spyder and it throws error
" return self.do_open(http.client.HTTPConnection, req)
File "C:\Users\name\AppData\Local\Continuum\Anaconda3-5.2.0\lib\urllib\request.py", line 1320, in do_open
raise…

anonymous13
- 581
- 1
- 5
- 17
0
votes
1 answer
FancyURLopener.version equivalence in requests
Sometimes it's necessary to change the version attribute when retrieving a request using FancyURLopener, e.g.
from urllib.request import FancyURLopener
class NewOpener(FancyURLopener):
version = 'Some fancy thing'
url = 'www.google.com'
opener…

alvas
- 115,346
- 109
- 446
- 738
-1
votes
1 answer
Getting [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590) error when trying to read a URL through FancyURLopener
I am trying to execute below code (reading content from a html) using FancyURLopener. The code was working fine for last 2 months or so , but now it has started to throw the error : IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED]…