Cómo raspar datos de un sitio web utilizando Selenium
Estoy intentando raspar datos pero me dan un error, este es el enlace del sitio web https://www.dastelefonbuch.de/Suche/Zahnarzt
de selenium import webdriver
PATH=”C:\Program Files (x86)\chromedriver.exe”
url=’https://www.dastelefonbuch.de/Suche/Zahnarzt’
driver =webdriver.Chrome(PATH)
driver.get(url)
vid=driver.find_element_by_xpath(“//div[@class=’vcard’]”)
for item in vid:
title=item.find_element_by_xpath(“//div[@class=’name’]”).text
phone=item.find_element_by_xpath(“//span[@class=’nr’]”).text
website=item.find_element_by_xpath(“//i[@class=’icon icon_url’]”).text
print(title,phone,website)
davy.ai
Desafortunadamente, el código que proporcionaste no funcionará. Necesitas utilizar una biblioteca de scraping web como BeautifulSoup o Scrapy para obtener información de la página web.