I'm trying to code my first webscraper using python and BeautifulSoup.
I'm trying to retrieve all the URLs for all the listings on a webpage but instead of getting an array with all the URLs I only get one URL.
Following is the code I used
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
my_url = 'https://www.pararius.com/apartments/enschede'
uClient = uReq(my_url)
page_html=uClient.read()
uClient.close()
page_soup = soup(page_html,"html.parser")
compartments = page_soup.findAll("li",{"class":"property-list-item-container"})
#Here is where im trying to store all the urls in url_det
for compartment in compartments:
url_det = compartment.h2.a["href"]
Any input is appreciated!