How do I search for content on another site and fetch the result and post to our Android app?

I am developing an android application. I want to search the content of another website and retrieve the result and display it if it matches the search criteria.

Example: I have two sites: abc.com with product pro1 and pro2 and xyz.com with product pro1 and pro3

Now if I search for pro1 in my application, I have to get the url of pro1 with minimal details like BOM, release date, etc. as a result, which I will show in my application as

Found 2 results:

  • abc.com
  • xyz.com

And I will make the results interactive so that they open in a mobile browser.

+3


source to share


1 answer


This is a very general question, so I'll answer the general answer.

It looks like what you want to do is run a search on an existing website using your existing search structure.

What you need to find out:



  • Does the site have an existing external structure? For example, Google provides a VERY extensive set of libraries for doing all kinds of "magic" in several different languages, including Java. Other sites may have some kind of web service API searchable on their site. You will have to investigate this from your side, as the possibilities are truly endless.
  • Does the site have a corresponding search function? If so, then you can always "persuade" him to figure out what their search form is posting / posting, then mimicking it with HttpClient or some other Java tool. After that, you will need to parse the results. You can even read # 3
  • Do you need to search for the site yourself? If so, you're probably better off having some kind of server process doing "lookups" and aggregating them into some easily called web service that your application can call.

This is the best answer I can give you. There is no "standard" way to do searches, outside of it is implemented using HTML forms from a web page.

0


source







All Articles