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
0
votes
3 answers

python: Can't use urlopen!! from urllib, urllib2, clientcookie urlopen ssl error

I made some code for access particular site instead user. It's very similar to auto login program. My program receive userid and password from user and try access url with data and login, return login result. Here's code. from urllib import…
Caesar Mn
  • 35
  • 2
  • 6
0
votes
2 answers

python urllib2.urlopen(url) process block

I am using urllib2.urlopen() and my process is getting blocked I am aware that urllib2.urlopen() has default timeout. How to make the call unblockable? The backtrace is (gdb) bt #0 0x0000003c6200dc35 in recv () from /lib64/libpthread.so.0 #1…
user1371662
  • 103
  • 2
  • 7
0
votes
2 answers

HTTPConnection.request fails but urllib.request.urlopen works?

I've been stuck here for quite a while but can't find anything helpful. I'm trying to connect to a website and get a response json file in Python3. The code looks like below: conn = http.client.HTTPConnection('host.address') params = "xx"+ xx + "xx"…
user1537085
  • 404
  • 5
  • 18
0
votes
2 answers

urlopen always retrieves the same webpage

I am trying to parse webpages using urllib2, BeautifulSoup and Python 2.7. The problem lies upstream: each time I try to retrieve a new webpage, I get the one I already retrieved. However, pages are different in my webbrowser: see page 1 and page 2.…
Wok
  • 4,956
  • 7
  • 42
  • 64
-1
votes
3 answers

Word count script in Python

Can someone please explain me why there is 'b' in front of each word and how to get read of it? Script returns something like this: word= b'yesterday,' , count = 3 current_word = {} current_count = 0 text =…
A_K
  • 89
  • 6
-1
votes
1 answer

How to print fp in HTTPError?

After seeing this error with my urlopen() function: Traceback (most recent call last): File "test_urlopen.py", line 47, in response = request.urlopen(req, data, context=ctx) File "/lib64/python/lib/urllib/request.py", line 227,…
user2719735
  • 97
  • 2
  • 10
-1
votes
1 answer

How to parse text/plain content in gatewayscripting

Could anyone advise how to parse "text/plain" content received from HTTPS response using dp:urlopen() in gateway scripting. We can read the response as "readAsBuffer" to save the context but how can we parse the content. If the response content is…
Virat
  • 77
  • 1
  • 5
-1
votes
1 answer

Issue accessing a URL with error "urlopen error Tunnel connection failed" using pandas and matplotlib

the data source/file location on the web is: https://www.newyorkfed.org/medialibrary/media/survey/empire/data/esms_seasonallyadjusted_diffusion.csv However as there were issues connecting I saved it ('esms_seasonallyadjusted_diffusion.csv') locally…
Herman L
  • 165
  • 1
  • 7
-1
votes
1 answer

detecting the presence of text with BeautifulSoup

i trying check the presence of text on certain page(if you send precendently the text will appear in this zone otherwize it's blank). html= urlopen(single_link) parsed= BeautifulSoup.BeautifulSoup(html,'html.parser') lastmessages =…
yokaso75
  • 31
  • 1
  • 5
-1
votes
1 answer

Python3 Wolframalpha Giving Error: urllib.error.URLError

Alright so a few days ago I wrote this code and it worked fine. import wolframalpha app_id = "MY-APP-ID-HERE" client = wolframalpha.Client(app_id) my_input = input("Question: ") res = client.query(my_input) Then today it just stopped working,…
techset
  • 7
  • 8
-1
votes
1 answer

python urlopen returns error

I am trying to parse some data from 'https://datausa.io/profile/geo/jacksonville-fl/#intro', but I am not sure how to access it from python. My code is: adress, headers = urllib.request.urlretrieve(' …
Inexorable
  • 23
  • 4
-1
votes
2 answers

urlopen for loop with beautifulsoup

New user here. I'm starting to get the hang of Python syntax but keep getting thrown off by for loops. I understand each scenario I've reach on SO thus far (and my previous examples), but can't seem to come up with one for my current scenario. I am…
Jesse
  • 39
  • 6
-1
votes
1 answer

AppEngine no host given exception

I've got a Python app, that uses urllib.urlopen. It works fine on dev_appserver.py, but throws [Errno http error] no host given error on my GAE production server. The code is exactly the same, the url, it connects to, is hardcoded. I'm out of ideas,…
George
  • 8,368
  • 12
  • 65
  • 106
-1
votes
1 answer

python3 code to retrieve just one particular line from webpage source code

In my code I'm using urlopen but it fetches whole webpage.Is it possible to retrieve just one particular line number of the webpage source code so as to optimize my program say for eg I want to print line number 135 from the source code of this link…
dhvlnyk
  • 197
  • 2
  • 15
-1
votes
1 answer

python urlopen output wrong

cj=http.cookiejar.CookieJar() opener=build_opener(HTTPCookieProcessor(cj)) data={'uid' : uid , 'password' : password } #uid is username to the…
robert
  • 598
  • 1
  • 5
  • 12
1 2 3
24
25