1
對於我的抓取工程,我需要從JavaScript對象獲取產品詳細信息。如何使用XPath/HTMLAgilityPack讀取JavaScript對象
如何從下列JavaScript中有效獲取對象細節?我使用XPath和HTMLAgilityPack。
<script type="text/javascript">
var product = {
identifier: '2051189775', //PRODUCT ID
fn: 'Fit- Whiskered Dark Wash Skirt',
category: ['sale'],
brand: 'Brand Name',
price: '22.90', // this would be the discount price
amount: '31.80', // this would be the original price
currency: 'USD',
//List can me even more.
};
</script>
我還沒有嘗試過從JavaScript對象獲取細節。我直接從HTML獲取其他抓取工具的詳細信息。