Javascript function to scrape data from amazon.com

  • Estado: Closed
  • Premio: $30
  • Propuestas recibidas: 2
  • Ganador: rgarcia3934

Resumen del concurso

I need a good javascript developer on long term basis.

Current Requirement:
Javascript function that will scrape some data on amazon.com and returns a json object. If you know a better way of getting this data without scraping, that's fine too.

function getRankingInfo(url);

It should load the url using ajax, scrape the data and create json from the html. Below are 3 types of url's and outputs.

It should return the following information for a sample url: http://www.amazon.com/dp/B00Q2JC290/
{
"url": "http://www.amazon.com/dp/B00Q2JC290/",
"status":"success",
"rank": {
"Top": {
"Amazon Best Sellers Rank": "15"
},
"Next": [
{
"1": "<span class=\"fsh-ranks\">in&nbsp;<a href=\"http://www.amazon.com/best-sellers-shoes/zgbs/shoes/ref=pd_zg_hrsr_shoe_1_1\">Shoes</a> &gt; <a href=\"http://www.amazon.com/gp/bestsellers/shoes/679255011/ref=pd_zg_hrsr_shoe_1_2\">Men's</a> &gt; <a href=\"http://www.amazon.com/gp/bestsellers/shoes/6127770011/ref=pd_zg_hrsr_shoe_1_3\">Athletic</a> &gt; <b><a href=\"http://www.amazon.com/gp/bestsellers/shoes/1264575011/ref=pd_zg_hrsr_shoe_1_4_last\">Trail Running</a></b></span>"
},
{
"2": "<span class=\"fsh-ranks\">in&nbsp;<a href=\"http://www.amazon.com/best-sellers-shoes/zgbs/shoes/ref=pd_zg_hrsr_shoe_2_1\">Shoes</a> &gt; <a href=\"http://www.amazon.com/gp/bestsellers/shoes/679255011/ref=pd_zg_hrsr_shoe_2_2\">Men's</a> &gt; <a href=\"http://www.amazon.com/gp/bestsellers/shoes/6127770011/ref=pd_zg_hrsr_shoe_2_3\">Athletic</a> &gt; <b><a href=\"http://www.amazon.com/gp/bestsellers/shoes/679286011/ref=pd_zg_hrsr_shoe_2_4_last\">Men's</a></b></span>"
},
{
"2": "<span class=\"fsh-ranks\">#2</span> <span class=\"zg_hrsr_ladder\">in&nbsp;<a href=\"http://www.amazon.com/best-sellers-shoes/zgbs/shoes/ref=pd_zg_hrsr_shoe_3_1\">Shoes</a> &gt; <a href=\"http://www.amazon.com/gp/bestsellers/shoes/679255011/ref=pd_zg_hrsr_shoe_3_2\">Men's</a> &gt; <b><a href=\"http://www.amazon.com/gp/bestsellers/shoes/6127766011/ref=pd_zg_hrsr_shoe_3_3_last\">Outdoor</a></b></span>"
}
]
},
"shipping":{
"Shipping Weight": "2.5 ponds"
}
}

It should return the following information for a sample url: http://www.amazon.com/dp/B01ALVMRM6
{
"url": "http://www.amazon.com/dp/B01ALVMRM6/",
"status": "NoRank",
"shipping":{
"Shipping Weight": "2.7 ponds"
}
}

It should return the following information for a sample url: http://www.amazon.com/dp/B00MUHUCBI
{
"url": "http://www.amazon.com/dp/B00MUHUCBI",
"status": "subrank",
"rank": {
"ranks": [
{
"4369": "<span>#4,369 in Cell Phones &amp; Accessories (<a href=\"/gp/bestsellers/wireless/ref=pd_dp_ts_cps_1\">See Top 100 in Cell Phones &amp; Accessories</a>)</span>"
},
{
"48": "<span>#48 in <a href=\"/gp/bestsellers/wireless//ref=pd_zg_hrsr_cps_1_1\">Cell Phones &amp; Accessories</a> &gt; <a href=\"/gp/bestsellers/wireless/2407755011/ref=pd_zg_hrsr_cps_1_2\">Cell Phone Accessories</a> &gt; <a href=\"/gp/bestsellers/wireless/7072563011/ref=pd_zg_hrsr_cps_1_3\">Mounts &amp; Stands</a> &gt; <a href=\"/gp/bestsellers/wireless/7073961011/ref=pd_zg_hrsr_cps_1_4_last\">Stands</a></span>"
},
{
"4369": "<span>#4,369 in <a href=\"/gp/bestsellers/electronics//ref=pd_zg_hrsr_cps_1_1\">Electronics</a> &gt; <a href=\"/gp/bestsellers/electronics/2811119011/ref=pd_zg_hrsr_cps_1_2_last\">Cell Phones &amp; Accessories</a></span>"
}
]
},
"shipping":{
"Shipping Weight": "1.6 ounces"
}
}

Habilidades recomendadas

Comentarios del empleador

“Nice person to work with.”

Imagen del perfil kiranjulapalli, United States.

Tablero de aclaración pública

  • ananthanunni
    ananthanunni
    • 8 años atrás

    Hi. On it. I am writing a JS function for you. Is that okay? And, could you please clarify on what basis the STATUS is set in the result JSON?

    • 8 años atrás
    1. kiranjulapalli
      Organizador del concurso
      • 8 años atrás

      cool. Thanks for the update

      • 8 años atrás
    2. ananthanunni
      ananthanunni
      • 8 años atrás

      Could you please check my submission?

      • 8 años atrás
  • rgarcia3934
    rgarcia3934
    • 8 años atrás

    whats means status==subrank?

    • 8 años atrás
    1. kiranjulapalli
      Organizador del concurso
      • 8 años atrás

      Please visit the url in the example above and see the section on product information/details.

      • 8 años atrás
    2. kiranjulapalli
      Organizador del concurso
      • 8 años atrás

      Actually, don't worry about "subrank". "Success" or "NoRank" are good enough for now.

      • 8 años atrás
  • rgarcia3934
    rgarcia3934
    • 8 años atrás

    Good!, In a chrome browser extension we can manage the crossdomain policies.
    Then I will code a google chrome browser extension with the scrape function, simple UI or not UI

    • 8 años atrás
    1. rgarcia3934
      rgarcia3934
      • 8 años atrás

      I can do

      • 8 años atrás
    2. kiranjulapalli
      Organizador del concurso
      • 8 años atrás

      cool.

      • 8 años atrás
  • kiranjulapalli
    Organizador del concurso
    • 8 años atrás

    No ui needed. Cross domain is ok as it runs in extension pop up.

    • 8 años atrás
  • kiranjulapalli
    Organizador del concurso
    • 8 años atrás

    I only need JavaScript. It is running inside chrome browser extension.

    • 8 años atrás
  • rgarcia3934
    rgarcia3934
    • 8 años atrás

    or you need only javascript?

    • 8 años atrás
  • rgarcia3934
    rgarcia3934
    • 8 años atrás

    You web page (with the script) will be hosted in a web server that can acts like a proxy (with a simple php script)?

    • 8 años atrás
  • rgarcia3934
    rgarcia3934
    • 8 años atrás

    Hi, you will need a proxy to get data from amazon, due to the sameorigin crossdomain policies

    • 8 años atrás

Mostrar más comentarios

Cómo comenzar con los concursos

  • Publica tu concurso

    Publica tu concurso Fácil y rápido

  • Recibe montones de propuestas

    Consigue toneladas de propuestas De todo el mundo

  • Elige la mejor propuesta

    Elige la mejor propuesta ¡Descarga fácilmente los archivos!

Publica un concurso ahora o únete a nosotros hoy