Created
March 23, 2025 03:34
-
-
Save irazasyed/4b9570f00edf792df39d65126553bd98 to your computer and use it in GitHub Desktop.
Scrape Gold Prices from Popular Jewellers in India using FireCrawl AI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install with npm install @mendable/firecrawl-js | |
import FireCrawlApp from '@mendable/firecrawl-js'; | |
const app = new FireCrawlApp({apiKey: "YOUR_API_KEY"}); | |
const schema = z.object({ | |
gold_prices: z.array(z.object({ | |
karat: z.string(), | |
price: z.string(), | |
site: z.string(), | |
css_selector: z.string() | |
})) | |
}); | |
const extractResult = await app.extract([ | |
"https://www.malabargoldanddiamonds.com/goldprice", "https://www.tanishq.co.in/gold-rate.html?lang=en_IN", "https://bhimagold.com" | |
], { | |
prompt: "Extract the gold prices for 22kt and 24kt from the specified URLs. Ensure to capture the karat, the price, the site, and the CSS selector of the prices. Make sure to format the prices to only digits.", | |
schema, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment