Answer the question
In order to leave comments, you need to log in
For some reason, the Selenium parser does not receive all the elements?
The problem is that you need to get all the links to ads, and it only gets links to the first 2 ads and duplicates the links why
from selenium import webdriver
from time import sleep
base_link = 'https://www.milanuncios.com/moda-mujer/?vendedor=part&orden=relevance&fromSearch='
class MilanunciosParser(object):
def __init__(self, driver):
self.driver = driver
def parse(self):
self.page()
def page(self):
self.driver.get(base_link)
main_div = self.driver.find_elements_by_class_name('ma-AdCard-titleLink')
for url in main_div:
print(url.get_attribute('href'))
def main():
driver = webdriver.Chrome()
parser = MilanunciosParser(driver)
parser.parse()
if __name__ == '__main__':
main()
https://www.milanuncios.com/abrigos-y-chaquetas/ultimo-dia-de-la-gran-oferta-394525989.htm
https://www.milanuncios.com/abrigos-y-chaquetas/ultimo-dia-de-la-gran-oferta-394525989.htm
https://www.milanuncios.com/jerseys-mujer/jersey-lana-negro-aplicaciones-386796487.htm
https://www.milanuncios.com/jerseys-mujer/jersey-lana-negro-aplicaciones-386796487.htm
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question