urlopen Questions
10
Solved
I wanted to check if a certain website exists, this is what I'm doing:
user_agent = 'Mozilla/20.0.1 (compatible; MSIE 5.5; Windows NT)'
headers = { 'User-Agent':user_agent }
link = "http://www.abc...
10
I have tried
import urllib.request
or
import urllib
The path for my urllib is
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/__init__.py
I am wondering where is ur...
Percival asked 5/5, 2016 at 4:5
1
Solved
1. Deprecation problem
In Python 3.7, I download a big file from a URL using the urllib.request.urlretrieve(..) function. In the documentation (https://docs.python.org/3/library/urllib.request.htm...
Uneducated asked 6/7, 2019 at 14:32
10
Solved
I need to fetch data from a URL with non-ascii characters but urllib2.urlopen refuses to open the resource and raises:
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0131' in positio...
Epicedium asked 8/12, 2010 at 16:6
5
Solved
I want to manipulate the information at THIS url. I can successfully open it and read its contents. But what I really want to do is throw out all the stuff I don't want, and to manipulate the stuff...
Thereunder asked 13/4, 2014 at 23:36
4
Solved
12
Solved
With Python 3 I am requesting a json document from a URL.
response = urllib.request.urlopen(request)
The response object is a file-like object with read and readline methods. Normally a JSON obj...
Callboard asked 28/7, 2011 at 17:0
11
Solved
I have a script that fetches several web pages and parses the info.
(An example can be seen at http://bluedevilbooks.com/search/?DEPT=MATH&CLASS=103&SEC=01 )
I ran cProfile on it, and as ...
2
im trying to run a selenium in python on Kubuntu 14.04.
I get this error message trying with chromedriver or geckodriver, both same error.
Traceback (most recent call last):
File "vse.py", line ...
Manmade asked 4/8, 2018 at 13:47
0
I ran into a strange behavior of the requests package ... or so I believe:
(1) for a certain website, requests.get runs on Windows, but it freezes on Linux (or raises timeout error if timeout is s...
Auld asked 19/2, 2018 at 20:2
1
When I try to log out from the testing page, there occurs an connection refused error. This is the command / code I've used:
driver.find_element_by_xpath("//a[@href = '/logged/pages/user/logout.ph...
Pino asked 7/10, 2015 at 1:36
2
Solved
Motivation
Motivated by this problem - the OP was using urlopen() and accidentally passed a sys.argv list instead of a string as a url. This error message was thrown:
AttributeError: 'list' object...
Metcalf asked 19/6, 2017 at 15:54
1
I am trying to fetch a page and urlopen hangs and never returns anything, although the web page is very light and can be opened with any browser without any problems
import urllib.request
with url...
Necromancy asked 15/5, 2017 at 19:33
2
I am trying to open up an URL for my project and here is my code:
from urllib2 import urlopen
page = urlopen("https://docs.python.org/3/howto/urllib2.html")
contents = page.read()
It's just a si...
Strontia asked 20/7, 2016 at 3:18
5
Solved
They didn't mention this in python documentation. And recently I'm testing a website simply refreshing the site using urllib2.urlopen() to extract certain content, I notice sometimes when I update ...
4
Solved
My app relies on:
Python 3
Django 1.8
Weasyprint
Selenium
It runs flawlessly on dev and production environment, but not while testing with selenium.
Using weasyprint, I create a PDF from HTML,...
Hawkweed asked 21/7, 2015 at 22:15
1
Solved
I tried parsing a web page using urllib.request's urlopen() method, like:
from urllib.request import Request, urlopen
req = Request(url)
html = urlopen(req).read()
However, the last line r...
Anguilla asked 1/2, 2016 at 2:36
2
Solved
Hy!
I tried to open web-page, that is normally opening in browser, but python just swears and does not want to work.
import urllib.request, urllib.error
f = urllib.request.urlopen('http://www.book...
Shooter asked 12/11, 2014 at 18:49
2
Solved
I have read, that file opened like this is closed automatically when leaving the with block:
with open("x.txt") as f:
data = f.read()
do something with data
yet when opening from web, I need t...
Breen asked 28/10, 2014 at 22:11
2
Solved
Spent a good part of a day on this, and I'm realllly at my wit's end. I have 1 machine "A" with Python 2.6.6/2.7.2 installed, and another machine "B" with Python 2.6.7/2.7.2 installed.
On machine ...
5
Just trying to test out very simple Python JSON commands, but I'm having some trouble.
urlopen('http://www.similarsitesearch.com/api/similar/ebay.com').read()
should output
'{"num":20,"st...
Jessen asked 1/6, 2012 at 7:24
5
Solved
I'm trying to fetch the following webpage:
import urllib
urllib.urlopen("http://www.gallimard-jeunesse.fr/searchjeunesse/advanced/(order)/author?catalog[0]=1&SearchAction=1").read()
The resu...
3
I am using urllib2 for loading web-page, my code is:
httpRequest = urllib2.Request("http:/www....com")
pageContent = urllib2.urlopen(httpRequest)
pageContent.readline()
How can I get hold of the...
Madagascar asked 4/12, 2012 at 9:45
4
I am trying to use urllib2.urlopen to perform GET and POST requests via the Facebook Graph API. I noticed from here: https://stackoverflow.com/questions/2690723/facebook-graph-api-and-django
that I...
Frontlet asked 2/3, 2012 at 22:10
3
Solved
1 Next >
© 2022 - 2024 — McMap. All rights reserved.