1

I have some urls:

http://www.avito.ru/ryazan/avtomobili?pmax=50000&f=188_893b13978
http://www.avito.ru/ryazan/avtomobili?pmax=50000&f=188_898b13978
http://www.avito.ru/ryazanskaya_oblast/avtomobili?pmax=50000&f=188_898b13978
http://www.avito.ru/ryazanskaya_oblast/avtomobili?pmax=50000&f=188_898b13978
http://www.avito.ru/ryazanskaya_oblast/avtomobili?pmax=100000&pmin=50000&f=188_898b13978

I try to get content of this page I get an error urllib2.URLError: <urlopen error [Errno 10060] I use code urllib2.urlopen(url).read() What I do wrong?

1 Answers1

0

Its working fine for me. I used requests module to get the page. Python requests is better. If you dont have requests module installed you can install it by pip install requests

import requests

for url in urls: # if you are using a list to hold your urls
    r = requests.get(url)
    r.content # will display the entire page content

If this also doesnt work, its better to check your proxy connection.

Jeril
  • 7,858
  • 3
  • 52
  • 69
  • 1
    I get to this code `requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.avito.ru', port=80): Max retries exceeded with url: /ryazan/avtomobili?pmax=50000&f=188_893b13978 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 10061] \xcf\xee\xe4\xea\xeb\xfe\xf7\xe5\xed\xe8\xe5 \xed\xe5 \xf3\xf1\xf2\xe0\xed\xee\xe2\xeb\xe5\xed\xee,',)) ` –  Sep 07 '16 at 08:56