dtbiszu7724 2016-08-25 11:23
浏览 119

使用来自其他网站的数据制作产品,定价,运费计算器

I am making a product pricing and shipping calculator which will work from the data fetched by another shopping website. I got little bit of success it is showing product image, product price, name of product and status of product. But shipping system is not working because that website is using Javascript. I am using htmldom! and targeted website is: BANGGOOD.COM

INDEX PAGE

<form method="get" action="url_look.php">
<input type="text" placeholder="Banggood.com Product URL" name="keywords"/><input type="submit"  value="submit"/>
</form>

URL LOOK PAGE

<?php
require_once('simple_html_dom.php');
$keywords = str_replace(" ","-",$_GET['keywords']);
$url =  "$keywords";
$html = file_get_html($url);
echo "<div>";
foreach($html->find('div[class=item_box price],h1[itemprop=name],div[class=good_photo_max],div[class=status],div[class=item_box shipping]') as $product_title){
//for more details visit http://simplehtmldom.sourceforge.net/manual.html
echo "<li>".$product_title."</li>";
}
echo "</div>";
?>
<style>
ul {
 display: none;
}
li {
list-style: none;
}
</style>

Above code was provided by a stackoverflow member: Aqueel Aboobacker VP and now i modified his code to make a pricing, and shipping calculator.

Basically i want to show price and then people select shipping methods which will be fetch from Banggood.com and then total will appear in USD. note that each product on banggood have different shipping methods and different prices depends on country

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题