简体   繁体   English

如何从网页获取产品价格?

[英]How to get product price from web page?

I pull the html code from the web page but the price is not in the html code.我从网页中提取 html 代码,但价格不在 html 代码中。 Can you help me?你能帮助我吗?

Screenshot截屏

HtmlAgilityPack.HtmlWeb web = new HtmlAgilityPack.HtmlWeb();
HtmlAgilityPack.HtmlDocument doc = web.Load("https://www.ceptesok.com/powerball-tablet-60li");
string html = doc.DocumentNode.InnerHtml;

It depends on how the site owner has posted the price.这取决于网站所有者如何发布价格。 If it's dynamic you can see it by just doing the inspect element but if it's coming as a dynamic data(from database) then you cannot see it.如果它是动态的,您只需执行检查元素就可以看到它,但如果它是作为动态数据(来自数据库)来的,那么您将看不到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM