-1

I'm trying to get all the links of listing from mobile.de, but it gives me an empty list

from bs4 import BeautifulSoup
import requests

url = 'https://suchen.mobile.de/fahrzeuge/search.html?dam=0&isSearchRequest=true&ref=quickSearch&sb=rel&vc=Car'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')

links = []
for a in soup.find_all('a', class_='link--muted no--text--decoration result-item'):
    links.append(a.get('href'))

print(links)
Zqm
  • 11
  • 2

1 Answers1

0

It returns empty list because the website has ani-bot security. Which redirect you to the site with CAPTCHA instead of site with offers. There are no links on CAPTCHA site with provided criteria so script returns [] because there are no matches.

Avad
  • 197
  • 1
  • 8