I'm using BeautifulSoup to scrap a webpage. I want to save each url in a list. However the operator + is not working properly. This is the code:
for a in soup.find_all('a', class_="hotel_name_link url"):
hotel_url = "https://www.booking.com" + a['href']
hotels_url_list.append(hotel_url)
I have to do it this way because the a['href'] attribute only gets the file location in the server but not the whole url (for example:
/hotel/es/aqua-aquamarina.es.html?label=gen173nr-1BCAEoggJCAlhYSDNYBGigAYgBAZgBCrgBB8gBDNgBAegBAZICAXmoAgM;sid=aa0d6c563b3d74f5432fb5d5b250eee4;ucfs=1;srpvid=2d5d1564170400e8;srepoch=1514343753;room1=A%2CA;hpos=15;hapos=15;dest_type=country;dest_id=197;srfid=198499756e07f93263596e1640823813c2ee4fe1X15;from=searchresults
;highlight_room=#hotelTmpl)
But when I print the results it displays the following:
What can I do to concat the urls in a way that BeautifulSoup can handle?

strip()-"https://www.booking.com" + a['href'].strip()- then I get url whichrequestscan read with status200.