scrape ASIN from amazon URL using javascript

前端 未结 16 725
旧巷少年郎
旧巷少年郎 2021-01-30 11:42

Assuming I have an Amazon product URL like so

http://www.amazon.com/Kindle-Wireless-Reading-Display-Generation/dp/B0015T963C/ref=amb_link_86123711_2?pf_rd_m=ATVP         


        
16条回答
  •  遥遥无期
    2021-01-30 12:18

    You can scrape ASIN codes from the data-asin attribute in the search results using XPath.

    For example $x('//@data-asin').map(function(v,i){return v.nodeValue}) can be ran in Chrome's console.

提交回复
热议问题