Good day!
Python 3 * has written the following code, which gives a bunch of errors:
html.parser import from htmlparser import urlib.request import urlopen import glob from your_hotel_adres = "Http://www.booking.com/hotel/ua/boutique-hotel-kavalier.ru.html" your_hotel_sc1 = your_hotel_adres [2 9:31] your_hotel_pagename = '' i = 30 while I & lt; = Len (your_hotel_adres): I = i + 1 if your_hotel_adres [i: i + 5] == ".html": your_hotel_pagename = your_hotel_adres [32: i-3] breaking your_hotel_comm = "http://www.booking.com /reviewlist.ru.html = pagename = "+ your_hotel_pagename +"; cc1 = "+ your_hotel_ss1 +"; type = total; dist = 1; offset = 0; rows = 1000 "f = urlopen (your_hotel_comm)
< / Pre>This should download a webpage and write it in a variable so I run it, and I get many other errors:
& gt; & Gt; & Gt; F = urlopen ('http://www.booking.com/reviewlist.ru.html?pagename=boutique-hotel -kavalier; cc1 = ua; type = total; distribution = 1; offset = 0; rows = 1000') Traceback (most recent call final): File "& lt; stdin>", line 1, & lt; Module & gt; "C: \ Python34 \ lib \ urlib \ request.py" in the file "C: \ Python 34 \ lib \ urllib \ request.py", line 153, urlopen return opener.open (url, data, timeout). Line 461 File "C: \ Python34 \ lib \ urllib \ request.py", line 571, http_response 'http', request, feedback, code, msg, hdrs) File "C: Open Feedback = Meth (Request, Feedback) In the file "C: \ Python34 \ lib \ urlib \ request.py", line 433, _call_chain results in "\ Python34 \ lib \ urllib \ request.py", line 493, error result = self._call_chain (* args) In the func (* Args) file "C: \ Python34 \ lib \ urllib \ request.py", line 676, h "C: \ Python34 \ lib \ urllib \ Request.py", line 461, open response = meth (req, response) in the file "c: //t.p_a_public.open (new, timeout = req.timeout) \ "Python 34 \ lib \ urlib \ request.py", line 571, http_response 'http', request, response, code, msg, hdrs) file "C: \ Python34 \ lib \ urllib \ request.py", line 499 , The file "C: \ Python34 \ lib \ urlib \" in the self._call_chain (* args) file "C: \ Python34 \ lib \ urllib \ request.py", line 433, _call_chain result = func (* args) Request.py ", line 579, http_error_default to increase HTTPError (req.full_url, code, msg, hdrs, fp) urllib . Error.Http Error: HTTP Error 400: Bad Request
Help me, please! Just focused on one thing: the page that opens in the vbrauzere address of the page, is the form: and addresses, which generates my code: -qualier; Cc1 = ua; Type = total; Dist = 1; Offset = 0; How do rows = 1000 get it?
Comments
Post a Comment