Use AI model to generate css selector in the dynamic scraper

With dynamic page I use the picker to select the text to find the selector but sometimes It won’t find the correct selector no matter what I do so I’ve copied and pasted the source code of the page into chat gbt and asked it to find the css selector for the text I wanted to scrape then copy and paste it into the dynamic page selector field and works.

Is there a way to add an option where you enter a URL then give a prompt asking what to scrape? Example: Extract the company name, address, website, phone number and social from this page, Then have it automatically create the selectors for each?

1 Like

That sounds like a really useful way to incorporate AI.

Can you share the sample page where selector didn’t work but you got it to work using AI?

Also the prompt you used would help.

The difficulty might be in parsing the response from the AI, as sometimes it likes to answer in non standard ways.

This was the page 101 Chicken | Restaurants - Fort Lee Regional Chamber of Commerce, NJ and it was for the social media icons. I would select one with the picker but would show up blank on the export preview. I even ran it and also showed up blank so I copied the source code of the social icons for one of the companies and pasted into chatgbt and entered several prompts and eventually wound up with this: (but I don’t remember the prompts)

.gz-social-linkedin
.gz-social-facebook
.gz-social-instagram

I got the ai selector idea from another scraper I tested in the past named scrape graph ai. Here is the prompt screen: