Onclick tag for the page link

Hello everyone :slightly_smiling_face:

Happy New Year :partying_face:

Url: https://www.cheval-reference.com/directory/structure?type_quick=structure&country=1&departments_number%5B0%5D=1&page=12#search_result_block

On this site, I want to access the stable page to retrieve the facilities. I can't create a link to click on it. If I do element click, I arrive on the page but it stops there, it doesn't open the other links after.
In the source code, I came across this but I don't know how to exploit it. Is there something to do with the onclick when I inspect the first element? I haven't had any problems on other sites where the links were easy to find but I'm out of solutions.

<div class="xl:w-1/4 lg:w-1/3 md:w-1/2 sm:w-1/2 p-4 w-full cursor-pointer" onclick="document.location.href='/ecurie-equi-mountain';">
                           

Maybe we can go back on the previous page with a selector ?

Here is the actual sitemap :

{"_id":"chevalref","startUrl":["https://www.cheval-reference.com/directory/structure?type_quick=structure&country=1&departments_number%5B0%5D=1&page=12#search_result_block"],"selectors":[{"extractAttribute":"onclick","id":"loop_items","multiple":true,"parentSelectors":["_root"],"selector":"div.xl\\:w-1\\/4","type":"SelectorElementAttribute"}]}

Capture d’écran 2025-01-03 162010

I managed to retrieve the links in the onclick but I don't know if it can allow me to browse each page and how to use them

Thanks for your help.

you are absolutely right... You should collect all links, replace some unnecessary part to domain and start collecting your data by visiting each separate link... easy )

Is there a way i can insert all the links in one time in web scraper to visit them ? I didn't find the way if it's possible

This option is available in Cloud Scraper, but not on desktop:

On desktop you would need to do Export Sitemap, manually add the links, and Import Sitemap. Best to edit it on a validator like JSONlint:

yes, you can do it by using an alternative free dashboard to post your links... for example, this one...
easy ))

Thank you guys, you helped me so much :slightly_smiling_face:

Now I have another issue, is there a way to check if an element is present to avoid this kind of error ? Because it's not on every page.

ELEMENT_SELECTION_ERROR Syntax error, unrecognized expression: .items-center p.lg\:w-4/5 at getElements with [".items-center p.lg\\:w-4/5",0]

I guess if an element is not find, it just return an empty or null value. But the scraping stop if it doesn't find it.

you better use this selector:
.cursor-pointer

For exemple, here the code I have an issue with :

 <div class="flex flex-col text-center w-full mb-6">
                        <h2 class="sm:text-3xl text-2xl font-medium title-font text-gray-900">Présentation</h2>
                    </div>

                                        <div class="flex flex-wrap -mx-4 mt-6">
                                                <div class="lg:w-1/3 sm:w-1/2 p-4">
                            
                        </div>
                                                <div class="lg:w-1/3 sm:w-1/2 p-4">
                            
                        </div>
                                            </div>

When the scraper see <h2 class="sm:text-3xl text-2xl font-medium title-font text-gray-900">Présentation</h2> I have the error ELEMENT_SELECTION_ERROR Syntax error, unrecognized expression: I saw the tool just go next if it doesn't find. Maybe I did wrong

are you trying to select manually???

I did. When the page has the element, everything is fine. But if there is not, I have an error and the scraping stop

try to write your selector instead of selecting manually )
just have a try )