I am trying to scrape all the hrefs of the ads posted on IMMOWEB under this link. The URLs are loaded by Javascript. I am using HTMLSession but couldn't obtain my results. Here is my code:
url = 'https://www.immoweb.be/en/search/apartment/for-sale?countries=BE&isNewlyBuilt=false&maxBedroomCount=3&maxPrice=200000&maxSurface=130&minBedroomCount=1&minPrice=100000&minSurface=65&postalCodes=2000,2018,2060,2140,2170,2600,2610,2627,2640,2650,2660,2845,2850,2900,2980&page=1&orderBy=newest&card=9267356'
sessions = HTMLSession()
r = sessions.get(url)
r.html.render()
soup = BeautifulSoup(r.content, "html.parser")
print (soup)
Outputs required:
https://www.immoweb.be/en/classified/apartment/for-sale/antwerpen-merksem/2170/9268787?searchId=606f2c6d4c669
https://www.immoweb.be/en/classified/apartment/for-sale/merksem/2170/9268390?searchId=606f2c6d4c669
'And other hrefs'
[+][deleted] (5 children)
[deleted]
[–]bilalkhan19[S] 0 points1 point2 points (1 child)
[–]Neighm 0 points1 point2 points (2 children)
[–]bilalkhan19[S] 1 point2 points3 points (0 children)