python urlopen错误_urlopen()出错

再见!在

用python 3*编写了以下代码,其中给出了一系列错误:from html.parser import HTMLParser

import re

from urllib.request import urlopen

import glob

your_hotel_adres="http://www.booking.com/hotel/ua/boutique-hotel-kavalier.ru.html"

your_hotel_сс1=your_hotel_adres[29:31]

your_hotel_pagename=''

i = 30

while i <= len(your_hotel_adres):

i = i + 1

if your_hotel_adres[i:i+5] == ".html":

your_hotel_pagename=your_hotel_adres[32:i-3]

break

your_hotel_comm="http://www.booking.com/reviewlist.ru.html?pagename="+your_hotel_pagename+";cc1="+your_hotel_сс1+";type=total;dist=1;offset=0;rows=1000"

f = urlopen(your_hotel_comm)

它应该下载一个网页并将其写入变量。所以我运行它,得到很多错误:

^{pr2}$

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值