1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Amazon - How to extract model name from item description or API? Coding Wizards?

Discussion in 'Affiliate Programs' started by jamie3000, Oct 26, 2015.

  1. jamie3000

    jamie3000 Supreme Member

    Joined:
    Jun 30, 2014
    Messages:
    1,309
    Likes Received:
    586
    Occupation:
    Finance coder looking for semi-retirement
    Location:
    uk
    Take this non affiliate link as an example.

    http://www.amazon.co.uk/Canon-Powershot-SX240-Digital-Camera/dp/B0074K1JXQ

    How could I programmatically extract the model name of Powershot-SX240 from the page or from the Amazon API? Just for clarity I don't mean extract it literally from just this one page, I mean extract the model name from every items page. Most titles seem to have a lot of SEO waffle in them where as I just want the product name or model. I can't seem to find this in the HTML anywhere and I can't see this returned in the Amazon API (https://affiliate-program.amazon.co.uk/gp/advertising/api/detail/main.html)

    Thanks! :)
     
  2. jamie3000

    jamie3000 Supreme Member

    Joined:
    Jun 30, 2014
    Messages:
    1,309
    Likes Received:
    586
    Occupation:
    Finance coder looking for semi-retirement
    Location:
    uk
  3. nglbh

    nglbh Registered Member

    Joined:
    Jan 4, 2011
    Messages:
    93
    Likes Received:
    182
    If it is contained in the url like you said you just need some Regular expressions (regex) and you can extract it


    Code:
    http://regexone.com/