Parsing Flipkart using Java

Parsing Flipkart using Java

Hi webscrappers,
Herewith I have given the example working java code to parse flipkart and take the price of the given book (isbn).

I have used Jsoup library. you can download from here,
Jar Download:
Jsoup Jar

Java Program:

package in.javadomain;


import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class FlipkartBookPrice {
	public static void main(String[] args) throws IOException {
		String bookIsbn = "9780070264984";
		String fkPrice = getFlipkartPrice(bookIsbn);
		System.out.println("Flipkart Price of " + bookIsbn + ": \n" + fkPrice);

	private static String getFlipkartPrice(String bookIsbnNo)
			throws IOException {
		String baseUrl = "" + bookIsbnNo
				+ "";
		String fkPrice = null;
		Document doc = Jsoup.connect(baseUrl).timeout(0).get();
		fkPrice ="").select("span.pprice")
		return fkPrice;

Flipkart Price of 9780070264984:
Rs. 436

1,877 total views, 3 views today

2 thoughts on “Parsing Flipkart using Java

  1. hi ,
    can you plz help me , i want to call flipkart api to list adds on my website ho to do it with flipkart affiliation,
    i have created flipkart affiliation account but i dont now how to call it from java spring.

    1. Flipkart affiliate is to display their product details in iframe or using scripts. Please be clear on doubts/clarifications to help you better.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.