[Python] Facebook scraper elements

Discussão em 'Python' iniciado por Stack, Fevereiro 9, 2025.

  1. Stack

    Stack Membro Participativo

    I am exploring social media scraping. I am testing out FB marketplace vehicle scraping in python. I was able to pull the title, price, and locations of the listings, but I cannot pull the odometer and transmission.

    This is the listing: https://www.facebook.com/marketplac...al_source_map\":{\"9489291457781511\":111}}"}

    I have inspected the html code several times and cannot seem to capture the correct div class or span class for odometer and transmission. Here is my current code:

    '''

    # Odometer Selector
    odometer_div_selector = "div.x1gslohp.xkh6y0r" # Odometer container div
    odometer_value_selector = "span.x193iq5w.xeuugli.x13faqbe.x1vvkbs.xlh3980.xvmahel.x1n0sxbx.x1lliihq.x1s928wv.xhkezso.x1gmr53x.x1cpjm7i.x1fgarty.x1943h6x.x4zkp8e.x676frb.x1nxh6w3.x1sibtaa.xo1l8bm.xzsf02u"

    # Transmission Selector
    transmission_div_selector = "div.x1yztbdb.x1n2onr6" # Transmission container div
    transmission_value_selector = "span.x193iq5w.xeuugli.x13faqbe.x1vvkbs.xlh3980.xvmahel.x1n0sxbx.x1lliihq.x1s928wv.xhkezso.x1gmr53x.x1cpjm7i.x1fgarty.x1943h6x.x4zkp8e.x676frb.x1sibtaa.xo1l8bm.xzsf02u"


    '''

    Any suggestions would be greatly appreciated, thank you!

    Continue reading...

Compartilhe esta Página